WordWordMap

Undocumented in source.

Constructors

this
this(string[] keys, string[] values)
Undocumented in source.

Members

Functions

get
string[] get(string key)

Return the values given the key. Empty array will be returned if the key doesn't exist in the key set.

Properties

byKey
IterableKeys byKey [@property getter]

Returns a forward range which will iterate over the keys of the dictionary.

Examples

string to string

auto dictionary = new WordWordMap(["Win", "hot"], ["Lose", "cold"]);

assert(dictionary.get("Win") == ["Lose"]);
assert(dictionary.get("hot") == ["cold"]);

bool error_thrown = false;
try {
    dictionary.get("won");
} catch(KeyError e) {
    error_thrown = true;
}
assert(error_thrown);

Meta