HashTable.byValue

Returns a bidirectional range that iterats over the values of this $(D_PSYMBOL HashTable).

  1. ByValue byValue()
  2. ConstByValue byValue()
    struct HashTable(Key, Value, alias hasher = hash)
    const
    byValue
    ()
    if (
    isHashFunction!(hasher, Key)
    )

Return Value

A bidirectional range that iterates over the values of the container.

Examples

HashTable!(string, int) hashTable;
hashTable["one"] = 1;
hashTable["two"] = 2;

auto byValue = hashTable.byValue();
assert(!byValue.empty);

assert(byValue.front == 1 || byValue.front == 2);
assert(byValue.back == 1 || byValue.back == 2);
assert(byValue.front != byValue.back);

byValue.popFront();
assert(byValue.front == byValue.back);

byValue.popBack();
assert(byValue.empty);

See Also

$(D_PSYMBOL byKey).

Meta