The OpenD Programming Language

StringMap.opIndex

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

  1. auto opIndex()
  2. inout(T) opIndex(const(char)[] key)
    struct StringMap(T)
    ref @trusted pure inout
    inout(T)
    opIndex
    ()
    (
    scope const(char)[] key
    )

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