@nogc for structs, blocks or modules?

maik klein via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 15 19:13:48 PST 2016


On Tuesday, 16 February 2016 at 02:47:38 UTC, WebFreak001 wrote:
> On Tuesday, 16 February 2016 at 02:42:06 UTC, maik klein wrote:
>> I just seems very annoying to add @nogc to every function.
>
> you can mark everything as nogc with
>
> // gc functions here
>
> @nogc:
>
> // nogc functions here
> void foo() {}

Thanks, this should probably added to 
https://dlang.org/spec/attribute.html#nogc

I just realized that I can't even use @nogc because pretty much 
nothing in phobos uses @nogc


More information about the Digitalmars-d mailing list