--- Comment #4 from 2011-09-13 00:02:29 PDT ---

Foreach arguments behave like function arguments. Here they don't.
The variable can be optimized out, if no altering happens.
This will not happen in a debug build, where it is irrelevant in comparison to
every variable being accessed through the stack.

You can use ref, if you're having too expensive copies
foreach(ref const i; iter(0) .. iter(10)) as with every other foreach argument.

Most important it has an explicit rule, that one can alter the loop index
through using a ref index.
foreach(ref idx, v; [0, 1, 2, 3, 4, 5])
  idx += stride - 1;

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

Reply via email to