lambda function with "capture by value"
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 6 05:47:45 PDT 2017
On Saturday, 5 August 2017 at 18:37:31 UTC, Johnson Jones wrote:
> 1. I'm pretty sure that D creates the delegate "lazily" in the
> sense that the first call is what captures the variable.
It actually does it at function entry, allocating the memory for
the locals in the closure, so it never actually copies them.
More information about the Digitalmars-d-learn
mailing list