foreach (x; a .. b) and foreach_reverse (x; a .. b) should be disallowed for floats

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 18 09:04:45 PDT 2009


dsimcha wrote:
> 2.  Using retro() would not be a full replacement when it comes to arrays.  For
> example, you can't get the indices by doing a
> 
> foreach(i, elem; retro(someArray)) {}

This needs fixing.

> 4.  Iteration using the range interface is currently slower than with arrays.  I
> posted some benchmarks a while back that were meant to demonstrate something else
> but demonstrated this as a side effect.  This is unlikely to matter unless you're
> in a very small inner loop, such that the loop overhead is significant compared to
> the contents of the loop, but some people with insane performance requirements
> might care.

Yah, popFront changes two words instead of one.


Andrei



More information about the Digitalmars-d mailing list