1 Nov 01:37
Re: [system][filesystem v3] Question about error_codearguments
Detlef Vollmann <dv <at> vollmann.ch>
2009-11-01 00:37:04 GMT
2009-11-01 00:37:04 GMT
On 10/31/09 12:48, Andrey Semashev wrote:
> 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.
This was already discussed earlier in this thread.
And the issue is not so much that uncaught_exception() doesn't
always return what you want to know ("is it safe to throw?"),
but the exception safety guarantees that break if a destructor throws.
> 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.
I still somehow like it, but there are to many problems with it.
Detlef
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Of course hopefully I'm wrong and there's nothing to actually do....
John.
_______________________________________________
Unsubscribe & other changes:
RSS Feed