size_t for length on x64 will make app slower than on x86?

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 18 12:24:49 PST 2014


Am Tue, 18 Nov 2014 19:33:42 +0000
schrieb "bearophile" <bearophileHUGS at lycos.com>:

> Marco Leise:
> 
> > foreach (i; 0 .. a.length)
> > {
> >     somework();
> > }
> 
> Better:
> 
> foreach (immutable _; 0 .. a.length)
> {
>      somework();
> }
> 
> Unfortunately this syntax is not yet supported, for unknown 
> reasons:
> 
> foreach (; 0 .. a.length)
> {
>      somework();
> }
> 
> Bye,
> bearophile

I know, _ doesn't cut it for 2D operations (2 loops) though or
you end up with _ and __ or _1 and _2.

-- 
Marco



More information about the Digitalmars-d mailing list