Hash.opIndex

Fetch a value from the hash. Raise an error if the key does not exist in the hash.

class Hash(K, V)
@nogc pure nothrow
opIndex
(
in K key
)

Examples

immutable data = ["foo": V(1)];
immutable subject = new immutable(Hash!(string, int))(data);
auto result = subject.insert("bar", 2);
assert(result["bar"] == 2);
assert(result["foo"] == 1);

Meta