Revised RFC on range design for D2

Sean Kelly sean at invisibleduck.org
Fri Sep 12 17:41:09 PDT 2008


Walter Bright wrote:
> Sean Kelly wrote:
>> I've found this invaluable at times.  And it's actually supported by 
>> C++ containers.
> 
> It's a bad idea, as it can screw up optimization. For example, if you 
> are using a change-and-swap method of updating a collection, the 
> collection cached by the foreach may get trashed.

That's fine... the optimizer has to impose certain requirements.  For 
such things I'll simply continue using for loops.


Sean


More information about the Digitalmars-d-announce mailing list