foreach by value iteration

Daniel Murphy yebblies at
Sun Feb 26 01:57:10 PST 2012

"Peter Alexander" < at> wrote in message 
news:awuvuwxwgjezcdrfswyn at

> Perhaps the loop variable should be implicitly const so that this type of 
> thing won't happen?

Making it const would break heaps of valid use cases.  It should probably be 
an rvalue, and so should the index.  I think there's a discussion about this 
burried somewhere in bugzilla. 

More information about the Digitalmars-d mailing list