Detecting exception unwinding
Jonathan M Davis via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Feb 3 13:35:38 PST 2016
On Wednesday, February 03, 2016 11:47:35 Ola Fosheim Grøstad via Digitalmars-d-learn 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.
Yeah, and I'm pretty sure that we don't have anything like that at this
point. Feel free to create an enhancement request for it:
https://issues.dlang.org
At least that way, it's kept track of, though I certainly have no idea when
it might be implemented (presumably when someone needs it enough that they
take the time to do so).
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list