Variables should have the ability to be @nogc

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 08:53:44 PDT 2016


On Tuesday, 31 May 2016 at 14:47:12 UTC, Marco Leise wrote:
> I "solved" it with a UDA called GcScan in my code. It can be 
> attached to any field or type and is a tri-state. In the 
> undecided case (GcScan.auto) it recursively scans for potential 
> GC pointers, excluding those marked GcScan.no. In the decided 
> case (GcScan.yes/no) it simply assumes the user knows better 
> and short-circuits the recursion.
>
> [...]

This solution seems smarter than using the existing '@nogc' 
attribute. Plus one also for the fact that nothing has to be done 
in DMD.

Did you encounter the issue with protected and private members ?

For me when i've tested the template i've directly got some 
warnings. DMD interprets my 'getMember' calls as a deprecated 
abuse of bug 314 but in dmd 2.069 I would get true errors.


More information about the Digitalmars-d mailing list