Question about the new AA behavior in 0.19

S. dnewsgr at mephit.kicks-ass.org
Mon Aug 14 06:51:31 PDT 2006


On 2006-08-10 16:31:45 -0700, Anton V Staaf <dm at socialhacker.com> said:
> 
> import std.stdio;
> 
> void main ()
> {
>     static int[int]	init;
>     int[int][int]	array;
> 
>     array[12] = init;
> 
>     array[12][15]++;
> }

The fact that you are using ++ makes this code invalid even if the 
symptom you state is there.  (++ is a lookup and an increment.)

However, I think you are correct about the multidimensional problem 
anyways as I have run into it in the past.

I think you have to do:

array[12] = new int[int];
array[12][15] = 1;

for the time be-ing

-S




More information about the Digitalmars-d mailing list