Mimicking C++'s indexing behavior in D associative arrays

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 18 01:20:04 PST 2015


Rikki Cattermole:

> Foo*[string] bar;
> Foo v = *bar.grab("mykey");

Is this the setdefault of Python dicts? If this need is strong a 
new function could be added to Phobos (or even druntime if you 
want to reduce the number of hash computations).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list