foreach by value iteration

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


"Peter Alexander" <peter.alexander.au at gmail.com> wrote in message 
news:awuvuwxwgjezcdrfswyn at forum.dlang.org...

> 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