Deprecated language features

Steven Schveighoffer schveiguy at yahoo.com
Fri Feb 3 17:53:54 PST 2012


On Thu, 02 Feb 2012 12:53:38 -0500, bearophile <bearophileHUGS at lycos.com>  
wrote:

> Ali:
>
>> I think foreach_reverse and the associated opApplyReverse member  
>> function.
>
> I use it now and then. A possible replacement:
>
> foreach (i; 10 .. 0 : -1) {}

foreach_reverse is fine to keep for builtins and range specifiers, but I'd  
really like to get rid of it for every other use.  We already have foreach  
on a delegate to give us the equivalent functionality.

The worst thing is foreach_reverse on a delegate, since the delegate does  
nothing different when called in "reverse" mode!

-Steve


More information about the Digitalmars-d mailing list