StringMap.opIndex

Complexity: O(log(s)), where s is the number of the keys with the same length as the input key.

struct StringMap(T, U = uint)
ref @trusted pure inout
inout(T)
opIndex
()
(
scope const(char)[] key
)
if (
isMutable!T &&
!__traits(hasMember, T, "opPostMove")
&&
__traits(isUnsigned, U)
)

Examples

StringMap!double map;
map["c"] = 3.0;
map["La"] = 4.0;
map["a"] = 5.0;

map["La"] += 10;
assert(map["La"] == 14.0);

Meta