Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on C++ the Good Parts (2014). Parent comment
I guess it depends on your definition of "valid".
Let's say we have:
class Thing { public: Thing() { cout << "created" << endl; } ~Thing() { cout << "destroyed" << endl; } };
{ auto thing = make_unique<Thing>(); }
It's splitting hairs, I guess, but that's where I'd draw the line.
There are no comments on this comment yet.
I guess it depends on your definition of "valid".
Let's say we have:
Assuming the happy path, the new/delete version will be functionally identical to a more correct/idiomatic The malloc/free version won't call the destructor, and therefore doesn't do what a "normal" object would do.It's splitting hairs, I guess, but that's where I'd draw the line.