@nogc, exceptions, generic containers... Issues.

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 9 01:40:41 PDT 2014


On Tuesday, 9 September 2014 at 07:05:22 UTC, bearophile wrote:
> Meta:
>
>> let ratio = try!(div(x, y));
>>
>> becomes
>>
>> let ratio = match div(x, y)
>> {
>>    Ok(val) => val,
>>    Err(msg) => { return Err; }
>> }
>>
>> Maybe we need a similar solution for @nogc.
>
> Related:
> https://d.puremagic.com/issues/show_bug.cgi?id=6840
>
> Bye,
> bearophile

These are interesting, but they revolve more around avoiding the 
Exception altogether, rather than finding a solution to using 
exceptions in @nogc. In particular, these are pretty imperative 
solutions which (afaik) woulnd't work with 
constructors/destructors.


More information about the Digitalmars-d mailing list