AssocArray

Undocumented in source.

Members

Functions

getLvalue
V* getLvalue(const(K) key)

Lookup value associated with key and return the address to it. If the key has not been added, it adds it and returns the address to the new value.

opIndex
V opIndex(const(K) key)

Lookup and return the value associated with key, if the key has not been added, it returns null.

Properties

asRange
auto asRange [@property getter]

Gets a range of key/values for aa.

length
size_t length [@property getter]

Examples

auto foo = new Object();
auto bar = new Object();

AssocArray!(Object, Object) aa;

assert(aa[foo] is null);
assert(aa.length == 0);

auto fooValuePtr = aa.getLvalue(foo);
*fooValuePtr = bar;

assert(aa[foo] is bar);
assert(aa.length == 1);

Meta