'int' is enough for 'length' to migrate code from x86 to x64

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 21 17:50:11 PST 2014


On 11/21/14 12:22 PM, Marco Leise wrote:
> Am Fri, 21 Nov 2014 11:24:37 +0000
> schrieb "bearophile" <bearophileHUGS at lycos.com>:
>
>> Walter Bright:
>>
>>> I thought everyone hated foreach_reverse!
>>
>> I love it!
>>
>> Bye,
>> bearophile
>
> Hey, it is a bit ugly, but I'd pick
>
> foreach_reverse (i; 0 .. length)
>
> anytime over
>
> import std.range;
> foreach (i; iota(length).retro())

I agree, though "foreach (i; length.iota.retro)" is no slouch either! -- 
Andrei



More information about the Digitalmars-d mailing list