Find if keys are in two dimensional associative array

Michal Minich michal.minich at gmail.com
Sun Jan 17 06:55:33 PST 2010


On Sun, 17 Jan 2010 15:08:08 +0100, Mike Wey wrote:

> This should work.
> 
> float[int][char] aa;
> 
> aa['a'][123] = 4.56;
> 
> if ( 123 in aa['a'] )
> 	writeln(true);
> else
> 	writeln(false);


if 'a' is not there then "aa['a'] will either return null, or exception 
(I don't know exactly). This is not good in any case, because then asking 
"123 in null" will crash always...


More information about the Digitalmars-d-learn mailing list