DMD 0.167 release
Walter Bright
newshound at digitalmars.com
Mon Sep 18 14:27:33 PDT 2006
Chris Nicholson-Sauls wrote:
> Walter Bright wrote:
>> Array literals, by popular demand.
>>
>> http://www.digitalmars.com/d/changelog.html
>
> Okay, multidim new is still cool, but I've found that it only works if
> one uses the parenthetical form. In other words, this fails to compile:
> foo = new int[2][3];
>
> But this works just fine:
> foo = new int[][](2, 3);
>
> Not really a show-stopper in my opinion, but certainly lackluster. (The
> feature is still awesome to have, though!)
The reason it fails to compile is because:
new int[2][3]
allocates a 3 element array of int[2], not int[]. Static arrays are
different types from dynamic arrays.
More information about the Digitalmars-d-announce
mailing list