Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2004-05-15 10:41:36


"Andrei Alexandrescu (See Website for Email)" wrote:
[...]
> What does it/should it do if the guard function throws an exception? Is
> there some try/catch in ScopeGuard's destructor?
>
> I was never sure what to do there. You can't pass an error out, you can't
> throw... and to keep the library general, you can't do something like
> logging or writing to cerr. Any ideas?

Destructors shall have implicit throw() exception specification.
std::unexpected() shall be invoked at throw point (there shall
be no unwinding at all). Two-phase EH is the way to go.

regards,
alexander.

--
http://groups.google.com/groups?selm=40A4A365.85EC6B78%40web.de

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