My thoughts & experiences with D so far, as a novice D coder

John Colvin john.loughran.colvin at gmail.com
Wed Mar 27 11:41:42 PDT 2013


On Wednesday, 27 March 2013 at 18:06:46 UTC, Vidar Wahlberg wrote:
> I'm impressed and most grateful for the feedback, I've learned 
> some new things today :)
>
>> int i = 5;
>> auto foo = new int[][](i,i);
>
> Won't this create an array (with 5 elements) of arrays (with 5 
> elements), also called a "jagged array"? Where memory is not 
> necessarily continuously allocated and looking up values adds 
> another layer of indirection?
>

Unfortunately yes.

However, it's not a hard problem to overcome with a wrapper 
struct over a contiguous array.


More information about the Digitalmars-d mailing list