Is there anyway to make opApply @nogc?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 21 05:53:11 PDT 2016


On Tuesday, 21 June 2016 at 12:48:04 UTC, Gary Willoughby wrote:
> I have no idea what that means. Can anyone shed more light on 
> this, please?

So when you use local variables in a delegate, the compiler 
usually makes a copy of them just in case the delegate gets saved 
for later.

When you mark it scope, you promise that you won't save it for 
later, so the compiler skips making the copy.


More information about the Digitalmars-d-learn mailing list