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

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Nov 21 00:57:12 PST 2014


Daniel Murphy:

> void fun(int[] a)
> {
>    foreach_reverse(i, 0...a.length)
>    {
>    }
> }

Better (it's a workaround for a D design flaw that we're 
unwilling to fix):

foreach_reverse(immutable i, 0...a.length)

Bye,
bearophile


More information about the Digitalmars-d mailing list