Using algorithms with ranges

Andrea Fontana nospam at example.com
Thu Oct 3 08:52:22 UTC 2019


On Thursday, 3 October 2019 at 05:33:04 UTC, mipri wrote:
> void main() {
>     import std.range : iota;
>
>     foreach (x; iota(1, 10).withHistory)
>         writeln(x);
> }


This doesn't work as expected, I think.

auto r = iota(1,10).withHistory;

writeln(r.front);
writeln(r.front);


More information about the Digitalmars-d-learn mailing list