3 ms·
You can’t return null from a constructor (constructors have no return)
by roger10-4 5y ago
You can’t return null from a constructor (constructors have no return)
- worik 5y agoWhat dumb design. I thought the constructor returned a pointer to the memory created. No return? Stupid!
- gpderetta 5y agoFWIW, 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.
- worik 5y agoRight. Been a long time. I would still expect a constructor to return. How can you tell if it failed?