Changing elements during foreach

bearophile bearophileHUGS at lycos.com
Mon Oct 21 04:28:11 PDT 2013


Krzysztof Ciebiera:

> Is the following compiler behavior consistent with language 
> specification?

Changing elements during foreach is something to avoid, perhaps 
I'd like it to be statically forbidden. If you add to this the 
reference-struct nature of arrays, you get in troubles.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list