WordObjectMap

Undocumented in source.

Constructors

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

Members

Functions

get
T[] get(string key)

Return the values given the key. Raise KeyError if key not found.

Properties

byKey
IterableKeys byKey [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

string to int

auto dictionary = new WordObjectMap!(int)(["one", "two"], [1, 2]);
assert(dictionary.get("one") == [1]);
assert(dictionary.get("two") == [2]);


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

Meta