[Issue 6652] foreach parameter with number range is always ref

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 17 15:29:29 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=6652



--- Comment #17 from bearophile_hugs at eml.cc 2012-06-17 15:31:45 PDT ---
Just a note.

void main() {
    import std.stdio;
    auto array = [10, 20, 30, 40, 50];
    foreach (i, item; array) {
        writeln(item);
        i++;
    }
}


Currently it prints:

10
30
50

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list