Using closure causes GC allocation

Azi Hassan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Sep 4 07:42:45 PDT 2017


On Monday, 4 September 2017 at 05:45:18 UTC, Vino.B wrote:
>   In order to resolve the issue "Using closure causes GC 
> allocation" it was stated that we need to use delegates

Alternatively you can drop the functional style and use a foreach 
loop that doesn't require delegates, but you'd still need the GC 
to store the result in an array. And even then you could still 
use Array (from std.container).


More information about the Digitalmars-d-learn mailing list