About foreach loops

bearophile bearophileHUGS at lycos.com
Fri Jun 17 10:32:51 PDT 2011


Jacob Carlborg:

> I agree with this. The iteration variable should not be changeable by 
> default and to get the current behavior one could add "ref".

Thank you for all the answers. It seems most people agree with this idea (about 90%+ comments are positive). I think Andrei is not against this idea, if limited to normal numbers. I'd like to know if Walter is OK with this little change in D.

Bye,
bearophile


More information about the Digitalmars-d mailing list