4 ms·
Why not just put a and b on the stack then? ;) Bjarne says, "Code that creates an object using new and then deletes it at the end of the same scope is ugly, er
by WizzleKake 11y ago
Why not just put a and b on the stack then? ;)
Bjarne says, "Code that creates an object using new and then deletes it at the end of the same scope is ugly, error-prone, and inefficient."
- KeytarHero 11y agoBecause it's an example of allocating things on the heap. You could also say the same about the "good" RAII version shown - but then there wouldn't be much point to the article, would there?