Repost: make foreach(i, a; range) "just work"

w0rp devw0rp at gmail.com
Fri Feb 21 00:49:09 PST 2014


On Friday, 21 February 2014 at 02:34:30 UTC, Jesse Phillips wrote:
> I don't see enough benefit for making this a language feature.
>
>
>     foreach(i, v1, v2; tuple(0,1).repeat(10).enumerate)
>         writeln(i, "\t", v1, "\t", v2);
>
> This works today! And once enumerate is part of Phobos it will 
> just need an import std.range to use it.

This.


More information about the Digitalmars-d mailing list