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.

Reply via email to