Detecting exception unwinding

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 3 23:55:42 PST 2016


On 02/03/2016 03:47 AM, Ola Fosheim Grøstad wrote:
> On Wednesday, 3 February 2016 at 11:41:28 UTC, Jonathan M Davis wrote:
>> AFAIK, there is no way to detect whether an exception is in flight or
>> not aside from the cases where scope(failure) or catch would catch the
>> exception, and from what I recall of the last time that someone asked
>> this question, the consensus was that it couldn't be done - but maybe
>> I'm remembering incorrectly. I am pretty sure that this was asked
>> within the last few months though, so if you search D.Learn, you can
>> probably find that discussion.
>
> :-/
>
> I am looking for something like this:
>
> http://en.cppreference.com/w/cpp/error/uncaught_exception
>
> It is useful for certain types of libraries where you want to cancel out
> effects "undo commits" when exceptional situations arise.
>
>

std::uncaught_exception used to be considered useless:

   http://www.gotw.ca/gotw/047.htm

Does that apply to D?

Ali



More information about the Digitalmars-d-learn mailing list