foreach_reverse is better than ever

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Sun Feb 14 03:14:59 PST 2010


Andrei Alexandrescu wrote:
> Gone, that is. Walter agreed to remove it.
> 
> To achieve the functionality of
> 
> foreach_reverse (r) { ... }
> 
> use
> 
> foreach (retro(r)) { ... }
> 
> using retro in std.range.


Let me first say that I think it's great that one of D's ugliest 
keywords is going away. But does retro (or ranges in general) support 
iteration over both index and element?

   foreach_reverse(i, e; foo) { ... }

-Lars



More information about the Digitalmars-d mailing list