scope guards

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 5 10:57:45 PDT 2014


On Tuesday, 5 August 2014 at 16:31:51 UTC, Jacob Carlborg wrote:
> On 2014-08-05 01:10, Sean Kelly wrote:
>
>> The easiest thing would be to provide a thread-local reference 
>> to
>> the currently in-flight exception.  Then you could do whatever
>> checking you wanted to inside the scope block.
>
> That's quite clever. Can we do that?

I don't see why not.  The exception handling code would need to
set and clear the reference at the proper points, but this
shouldn't be too difficult.  We'd have to be careful how it's
documented though.  I think it's mostly applicable to Manu's
case--specializing code in scope guards.  For example:
http://www.gotw.ca/gotw/047.htm


More information about the Digitalmars-d mailing list