How long does the context of a delegate exist?

frame frame86 at live.com
Thu May 27 20:39:48 UTC 2021


On Thursday, 27 May 2021 at 16:17:12 UTC, Alain De Vos wrote:
> I think of a dynamic array as a value-type consisting of a 
> pointer to the actual data and a length, which gets copied.
> The data pointing to will continue to live.
> The pointer and length might disappear from the stack or get 
> copied.
> I think there is no problem.

Seems logical, I just do not know exactly what a delegate 
internally does with captured variables from the function body. 
But you are right it must be something like that.


More information about the Digitalmars-d-learn mailing list