[Issue 5306] Disallow foreach ref on numeric interval

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 20 12:36:29 PST 2012


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|                            |INVALID


--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> 2012-01-20 12:36:27 PST ---
It is not meaningless. The following program:

import core.stdc.stdio;

void main() {
    foreach (ref i; 0 .. 10) {
        printf("i = %d\n", i);
        i++;
    }
}

works as expected:

i = 0
i = 2
i = 4
i = 6
i = 8

-- 
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