What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from 2011-09-12 12:24:41 PDT ---
Recently I have started a very long thread about this problem:

An alternative and probably a bit better solution is to think of 0..10 as a
immutable entity (just like the integer number "1" is immutable, likewise a
range of numbers is immutable), so the foreach index is a const (the compiler
keeps only one index, for efficiency, and modifies this const index):

foreach (int i; 0 .. 10) {
    i++; // forbidden, i is const

If you want to modify the index variable inside the loop, then you use a for()

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to