Hacker News new | ask | show | jobs
by worik 1576 days ago
What dumb design.

I thought the constructor returned a pointer to the memory created.

No return? Stupid!

1 comments

FWIW, constructors do not "create" (I assume you mean allocate) memory. That's the job of operator new. A constructor, given a block of untyped memory, will construct an object in it.
Right.

Been a long time.

I would still expect a constructor to return. How can you tell if it failed?