Array append performance 2

Christian Kamm kamm-incasoftware at removethis.de
Sun Aug 31 06:56:10 PDT 2008


> Extra note: while creating it I have found another bug in DMD I didn't
> know about:
> 
> import std.stdio: writefln;
> void main() {
>     alias int[2] T;
>     writefln(T.init);
> }
> 
> This program has to print [0,0] instead of 0.

Actually, I don't think the D spec requires typeof(T.init) == T. And T is a
valid initializer for T[N]:

int[3] arr = 5; // sets all elements to 5

Christian



More information about the Digitalmars-d mailing list