Skip to content

Comment on Never trust a programmer who says he knows C++parent

Comments

What about

  SomeComplexObject b = new SomeComplexObject()
This should probably be
  SomeComplexObject* b = new SomeComplexObject()
since the former news up an object and then invokes a copy constructor before losing the original reference and leaking.

It's also missing a semicolon.

I omitted the lines that were completely wrong, like that one. That assignment wouldn't compile at all.

Good points (wheels and masterj)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.