Should range foreach be iterating over an implicit copy?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 16 14:40:38 PDT 2012


On 5/16/12 4:37 PM, Nick Sabalausky wrote:
> One counter-argument that was raised is that TDPL has an example on page 381
> that indicates foreach iterates over an implicit copy. I don't have a copy
> handy ATM, so I can't look at it myself, but I'd love to see Andrei weigh in
> on this: I'm curious if this example in TDPL made that copy deliberately, or
> if the full implications of that copy were just an oversight.

It is deliberate and the intent is that millions of programmers used to 
foreach from other languages don't scream "where is my range???"

Andrei



More information about the Digitalmars-d mailing list