Delegates and values captured inside loops

Anonymouse zorael at gmail.com
Sun Jan 21 12:19:39 UTC 2024


On Saturday, 20 January 2024 at 16:32:42 UTC, FeepingCreature 
wrote:
>
> ```
> foreach (name; names)
> {
>     dgs ~= ((name) => () => writeln(name))(name);
> }
> ```
> lol

Thanks, I'll try that.


More information about the Digitalmars-d-learn mailing list