RehashingAA.get

Retrieves the value for the key key, or returns the default value if there was none.

struct RehashingAA(AA : V[K], V, K)
ref
get
(
K key
,
lazy V value
)

Examples

RehashingAA!(int[int]) aa;
aa[1] = 42;
aa[2] = 99;

assert(aa.get(1, 0) == 42);
assert(aa.get(2, 0) == 99);
assert(aa.get(0, 0) == 0);
assert(aa.get(3, 999) == 999);

assert(0 !in aa);
assert(3 !in aa);