On Friday, 5 October 2018 at 06:56:49 UTC, Nicholas Wilson wrote:
On Friday, 5 October 2018 at 06:44:08 UTC, Nicholas Wilson wrote:
Alas is does not because each does not accept additional argument other than the range. Shouldn't be hard to fix though.

https://issues.dlang.org/show_bug.cgi?id=19287

You can thread multiple arguments through to `each` using `std.range.zip`:

    tenRandomNumbers
        .zip(repeat(output))
.each!(unpack!((n, output) => output.appendln(n.to!string)));

Full code: https://run.dlang.io/is/Qe7uHt

Reply via email to