About foreach loops

Jesse Phillips jessekphillips+d at gmail.com
Fri Jun 17 07:42:08 PDT 2011


On Wed, 15 Jun 2011 16:40:24 -0400, bearophile wrote:

> Isn't it undefined in D to modify a const?

Yes, but unlike what every redditer is say, that doesn't mean the 
compiler can do whatever it wants. It means you can't define its 
behavior. Go ahead try.

Throws an exception, nope, can't do that no information at run-time and 
const is already gone from a cast during compile-time.
Modifies value, nope, might not be possible.
Does nothing, nope, same as throwing exception.


More information about the Digitalmars-d mailing list