News for hackers. Stuff that matters.
Re:Deep C and C++ (2011) by yngccc on Wednesday October 23, 2013 @02:31AM (#6597248)
The girl forgot to mention exception safety on the class A slide, no hire.
Re:Deep C and C++ (2011) by jmgao on Wednesday October 23, 2013 @03:36AM (#6597427)
The constructor also wasn't tagged explicit.
Re:Deep C and C++ (2011) by kirab on Wednesday October 23, 2013 @04:31AM (#6597599)
If B() is noexcept then A() is actually exception safe. The only thing which could happen would be bad_alloc but then v does not have to be deleted any more.
Re:Deep C and C++ (2011) by zvrba on Wednesday October 23, 2013 @06:21AM (#6597881)
Right, like what happens with the memory allocated for px in situation like below, if new ClassY throws?

A::A() : px(new ClassX), py(new ClassY) { }

Re:Deep C and C++ (2011) by hamidr on Wednesday October 23, 2013 @03:35AM (#6597425)
lol yeah But she is a C programmer you know ? ;)