use variant as associative array

GG g at g.com
Wed Feb 10 13:28:08 PST 2010


I try to use variant as associative array with dmd2.039, 

Variant[char[]][int] aa;
aa[0]["Month"] = "Jan";
aa[0]["Profit"] = 500;
aa[1]["Month"] = "Feb";
aa[1]["Profit"] = 800;

I got core.exception.RangeError at main(28): Range violation
I'm doing something wrong ? Or it's same problem as :
http://digitalmars.com/d/archives/digitalmars/D/Variant_string_associative_array_..._fail_87248.html
Same problem with dmd2.040

Thanks !
GG


More information about the Digitalmars-d-learn mailing list