Hacker News new | ask | show | jobs
by liquidify 1828 days ago
Any raw new in code is a smell. I thought this was old news?
1 comments

I've noticed that every few years when I look at C++ again, everyone says this about whatever was correct last time.
Pretty sure that raw new has been a smell since C++11, 10 years ago, since the introduction of smart pointers that aren't terrible. Maybe longer than a few years since last time you looked at it!
Non-terrible smart pointers existed well before that (no, auto_ptr doesn't count), so naked new and delete have been code smell for a while.
Yes, one time I looked and people were saying new was bad and to use auto_ptr, and then the next time I looked everyone was saying that had never happened.