Subject: Re: [boost] [system][filesystem v3] Question about error_codearguments
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2009-10-31 07:48:59
Detlef Vollmann wrote:
> But the basic problem of throwing exceptions from destructors exists,
> and is IMO a major flaw of how exception handling works in C++,
> but I don't think that this will change.
FWIW, the language allows to work around this problem. You can use
std::uncaught_exception to detect whether to throw exception in a
destructor or not.
Regarding the original idea of returning an object that would throw in
its destructor, I don't see this problem at all, as this object can only
be returned if there is no exception propagating. However, I can't say
I'm in favor of this idea.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk