News for hackers. Stuff that matters.
Re:Ill-Advised C++ Rant, Part 2 by cousin_it on Tuesday March 08, 2016 @06:43AM (#11244707)
Well, that example doesn't use catch, so it doesn't really tip the scales on catchable vs uncatchable exceptions. It does show that you have to be extra careful when making function calls from unsafe blocks, and that destructors are especially error prone. I agree with all that :-)
Re:Ill-Advised C++ Rant, Part 2 by Manishearth on Tuesday March 08, 2016 @08:09AM (#11244954)
Recover is basically catch, it shows how a panic can leave something in a invalid and unsafe state, which can be accessed after recovery (without recover you wouldn't be able to access it). :)
Re:Ill-Advised C++ Rant, Part 2 by cousin_it on Tuesday March 08, 2016 @08:55AM (#11245194)
You can see the invalid state even without catch/recover, e.g. from destructors that are called during unwinding.
Re:Ill-Advised C++ Rant, Part 2 by Manishearth on Tuesday March 08, 2016 @01:48PM (#11247479)
Ah, I see. Right, that works in this case, but it doesn't work in all -- you can come up with a situation where the destructor is fine but the recovery can lead to arbitrary unsafe things.