|
Boost : |
From: Howard Hinnant (hinnant_at_[hidden])
Date: 2007-09-13 20:40:06
On Sep 13, 2007, at 5:54 PM, Emil Dotchevski wrote:
> Howard Hinnant wrote:
>> I am requesting comments, both for and against a "sticky exception".
>> A sticky exception is one in which once thrown, is very hard to catch
>> and handle, without an implicit rethrow. This represents some
>> condition which the thrower believes is sufficiently severe that the
>> application (or thread) should clean up resources, but not be allowed
>> to continue, even with a catch (...) which does not rethrow.
>
> Here are a two arguments against:
>
> 1) The whole point of throwing an exception is that the program _can_
> recover and not just clean up and exit.
>
> 2) If I write catch(...) in a destructor, I would be unpleasently
> surprised
> if it ends up throwing after all.
>
> What use cases do you have in mind anyway?
Thanks Emil. I'm conducting a personal sanity check. Some people
just do this with a dipstick. I prefer to consult with my colleagues
on boost. :-)
I will definitely answer your question but I'd prefer not to for
another day or two. I'm hoping to not influence other's answers one
way or another for now. I'm exploring a design space of a sensitive
subject, and saying more than I have risks tainting the unbiased
responses I'm seeking. I very much appreciate you posting your
arguments and hope others will do so as well.
-Howard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk