HashTable.opIndex

Returns a bidirectional range whose element type is a tuple of a key and the respective value.

  1. Value opIndex(T key)
  2. Range opIndex()
  3. ConstRange opIndex()
    struct HashTable(Key, Value, alias hasher = hash)
    const
    opIndex
    ()
    if (
    isHashFunction!(hasher, Key)
    )

Return Value

A bidirectional range that iterates over the container.

Examples

HashTable!(string, int) hashTable;
assert(hashTable[].empty);

hashTable["Iguanodon"] = 9;
assert(!hashTable[].empty);
assert(hashTable[].front == hashTable.KeyValue("Iguanodon", 9));
assert(hashTable[].back == hashTable.KeyValue("Iguanodon", 9));

Meta