Can pointers to values inside associative arrays become invalid?
Idan Arye via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Jan 6 08:18:17 PST 2015
I have an associative array, and I use the `in` operator to get a
reference to a value inside it and store it in a pointer:
int[string] aa;
aa["myKey"] = 42;
int* myPointer = "myKey" in aa;
Is it possible that due to rehashing or something D will decide
to move the associative array's values around, resulting in
`myPointer` no longer pointing to `aa["myKey"]`?
More information about the Digitalmars-d-learn
mailing list