Loop optimization

Simen kjaeraas simen.kjaras at gmail.com
Sat May 15 17:45:50 PDT 2010


Ali Çehreli <acehreli at yahoo.com> wrote:

> Steven Schveighoffer wrote:
>
>  >     double [] foo = new double [cast(int)1e6];
>  >     foo[] = 0;
>
> I've discovered that this is the equivalent of the last line above:
>
>    foo = 0;
>
> I don't see it in the spec. Is that an old or an unintended feature?

Looks unintended to me.  In fact (though that might be the
C programmer in me doing the thinking), it looks to me like
foo = null;. It might be related to the discussion in
digitalmars.D "Is [] mandatory for array operations?".

-- 
Simen


More information about the Digitalmars-d-learn mailing list