News for hackers. Stuff that matters.
Re:C++ in Coders at Work by zeugma on Tuesday February 15, 2011 @10:11AM (#2221447)
About constructor/destructor: in C++ you call allocate object on the stack, destructor will be called when you get outside the scope of the variable. That feature, dumbed RAII in C++ lingo, may be the simple GC your looking for : no explicit delete, good locality of the destruction. It also allow correct handling of exception.
Re:C++ in Coders at Work by barrkel on Tuesday February 15, 2011 @10:19AM (#2221479)
Ironically, it's copy constructors which show up to break exception safety horribly if you're trying to be ultra-safe - cf. no stack<T>::pop() that returns the value popped. What C++ adds with one hand, it takes away with two more hands that popped up out of nowhere like mutant growths.
Re:C++ in Coders at Work by dzorz on Tuesday February 15, 2011 @03:02PM (#2222994)
C++0x solves that issue by introducing rvalues.