'auto' with AA

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 27 21:32:38 PDT 2014


fOn 04/27/2014 06:00 PM, David Held wrote:

 > I would like to do something like this:
 >
 > Foo[Bar][Baz] nestedAA;
 > auto innerAA = nestedAA[someBaz];
 > innerAA[someBar] = someFoo;
 > assert(someFoo in nestedAA[someBaz]);

in operator uses a key, not a value. This should work:

     assert(someBar in nestedAA[someBaz]);

Ali



More information about the Digitalmars-d-learn mailing list