MultiValueMap.opBinaryRight

Implements opBinaryRight for the "in" operator, such that k in m will resolve to the list of values for key k in the multivalue map m if that key exists, or null if not.

struct MultiValueMap(KeyType, ValueType, alias KeySort = (a, b) => a < b)
ValueType[]
opBinaryRight
(
string op : "in"
)
(
string lhs
)

Parameters

lhs string

The key to use.

Return Value

Type: ValueType[]

A list of values for the given key, or null if no such key exists.

StringMultiValueMap m;
m.add("a", "hello");
assert("a" in m);
assert(("a" in m) == ["hello"]);
assert("b" !in m);
assert(("b" in m) is null);