Boost logo

Boost :

Subject: Re: [boost] [Thread] Win32 exception handling
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2008-11-25 16:17:20


David Abrahams wrote:
[...]
> OK, great, a second data point. How do you feel about the fact that the
> upcoming standard requires the catch(...)?

IMO, that's very idiotic, if true.

User code doesn't expect some exception: suppose the case when caller
has made precautions so that this or that operation's documented
exception shall not occur in context established by caller.

And operation suddenly throws... that means broken program state... and
you insist on unwinding. Nonsense! The program shall abort() ASAP at
throw point. Cleanup for eventual external resources (if it really
matters/shall be reliable) shall be done by another higher level
(isolated) program (with clean state) acting as watchdog (broken state
program can not be trusted to do any cleanup of external resources).
Cleanup for stack frames ("locals") makes even less sense, given broken
program state (possibly including stack frames).

Dejavu...

http://lists.boost.org/Archives/boost/2003/10/54064.php

regards,
alexander.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk