Problem with associative arrays

Piotr Szturmaj bncrbme at jadamspam.pl
Sat Mar 19 09:29:46 PDT 2011


Shouldn't dynamic array be reference type?

uint[][uint] aa;
uint[] temp;
	
aa[5] = new uint[0];
temp = aa[5]; // copy uint[] reference
temp ~= 1;
	
assert(temp.length == 1 && temp[0] == 1); // pass
assert(aa[5].length == 1 && aa[5][0] == 1); // fail

Is this a bug?


More information about the Digitalmars-d-learn mailing list