DIP60: @nogc attribute

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 17 15:04:19 PDT 2014


On 4/17/2014 1:03 PM, John Colvin wrote:
> E.g. you can implement some complicated function foo that writes to a
> user-provided output range and guarantee that all GC usage is in the control of
> the caller and his output range.

As mentioned elsewhere here, it's easy enough to do a unit test for this.


> The advantage of having this as language instead of documentation is the
> turtles-all-the-way-down principle: if some function deep inside the call chain
> under foo decides to use a GC buffer then it's a compile-time-error.

And that's how @nogc works.


More information about the Digitalmars-d mailing list