Is there anyway to make opApply @nogc?

Gary Willoughby via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 21 12:21:01 PDT 2016


On Tuesday, 21 June 2016 at 12:53:11 UTC, Adam D. Ruppe wrote:
> 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.

Right ok, thanks! It doesn't seem to help though as the compiler 
complains about it being not @nogc.


More information about the Digitalmars-d-learn mailing list