On Fri, 24 Oct 2014 23:46:27 +0000
uri via Digitalmars-d-learn <[email protected]> wrote:

> On a related note, does the D spec guarantee the following will 
> be rectangular in memory?
> 
> auto a = [ [1,2],[3,4] ];
ah, no, it's not. this is array of arrays, i.e. 'int[][]'. only static
arrays are guaranteed to be placed as one block of data. this will:

  int[2][2] a = [ [1,2],[3,4] ];

we have a nice PR from Kenji that allows the following declarations:

  int[$][$] a = [ [1,2],[3,4] ];

but alas, it's not in the mainline yet.

Attachment: signature.asc
Description: PGP signature

Reply via email to