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.