Garbage collection and closures.

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 19 06:35:38 PDT 2017


On Monday, 19 June 2017 at 09:18:56 UTC, Dsby wrote:
>> void uses(scope void delegate() dg);
>>
>> will it be not alloc memory?
>
> I test it , if use scope it will not alloc memony.

Right, using `scope` at the point the delegate variable is 
defined means it will never allocate.


More information about the Digitalmars-d-learn mailing list