Plan for Exceptions and @nogc?

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 17 08:15:26 PST 2015


On 17/02/2015 07:28, weaselcat wrote:
> Would RefCounted!T being @nogc help alleviate this issue?

I think Andrei once said that was a good solution for exceptions.

I think the stumbling block is that if T contains indirections, 
RefCounted calls GC.addRange on the T*, which currently violates @nogc. 
Perhaps addRange should be allowed even with @nogc, as it doesn't 
trigger collections as of itself.

Otherwise, we would need some way of controlling whether addRange should 
be called by smart pointers or not.


More information about the Digitalmars-d mailing list