Error: variable 'xyz' has scoped destruction, cannot build closure

Nicholas Wilson iamthewilsonator at hotmail.com
Fri Oct 5 06:44:08 UTC 2018


On Friday, 5 October 2018 at 06:22:57 UTC, Nicholas Wilson wrote:
> tenRandomNumbers.each!((n,o) => 
> o.appendln(n.to!string))(output);
>
> or
>
> tenRandomNumbers.each!((n, ref o) => 
> o.appendln(n.to!string))(output);
>
> should hopefully do the trick (run.dlang.io seems to be down 
> atm).
>

Alas is does not because each does not accept additional argument 
other than the range. Shouldn't be hard to fix though.


More information about the Digitalmars-d-learn mailing list