D Language Gotchas
Meta
jared771 at gmail.com
Tue Nov 5 12:58:09 PST 2013
On Tuesday, 5 November 2013 at 17:14:23 UTC, safety0ff wrote:
> One other gotcha that I've run into is trying to use foreach on
> a range of tuples with an iteration index. It does not do what
> you might expect, try:
> import std.range, std.stdio;
> void main()
> {
> auto a = repeat(1,5);
> auto b = repeat(2,5);
> foreach(i, ab; a.zip(b)) writeln(i, " ", ab);
> }
>
> See bugzilla #5550 for bearophile's range.enumerate enhancement
> request.
Also this:
http://d.puremagic.com/issues/show_bug.cgi?id=10765
More information about the Digitalmars-d
mailing list