foreach on interval index by ref increment
Martin Nowak
dawg at dawgfoto.de
Sat Jan 21 20:13:20 PST 2012
It can be very useful to skip array elements.
---------
import std.stdio;
void main()
{
auto ary = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
foreach(ref i, e; ary)
writeln(i++, "|", e);
}
--------
I made a pull request to distinguish between ref and non-ref index
parameters.
http://d.puremagic.com/issues/show_bug.cgi?id=6652
But there is no deprecation path from the current behavior.
More information about the Digitalmars-d
mailing list