DMD 0.167 release
Walter Bright
newshound at digitalmars.com
Mon Sep 18 14:02:22 PDT 2006
clayasaurus wrote:
> Alright, is this feature supposed to work with multi-dimensional arrays
> as well? like...
>
> bob[][] = [[2,3], [4,2], [2,0]];
>
> I get 'invalid conversion from int[2][3] to int[][]'
Since T[n] and T[] are different types, one gets picked. But you can do:
int[][] bob = [ cast(int[])[2,3], [4,2], [2,0] ];
as the element type of the array is determined by the type of the first
element.
More information about the Digitalmars-d-announce
mailing list