Hacker News new | ask | show | jobs
by aw1621107 1268 days ago
There are non-throwing operator new overloads that can return nullptr, but I'm not sure if those are a relatively recent development. Did the non-throwing operator new overloads not exist at the time?
2 comments

Hard to say. Most of the uses probably predated the custom operator new and so nobody thought about it. Not to mention the places you cannot sneak into to switch to std::nothrow.
Ah, that's fair. Didn't think of code that couldn't be changed.
`new (nothrow)` was in C++98 and in ARM C++ before that.
Ah, I didn't know that. Thanks!