Function HashTable.opBinaryRight

Looks for key in this hash table.

bool opBinaryRight(string op : "in", T) (
  auto const ref T key
) const
if (ifTestable!(T, (a) => Key.init == a));

Parameters

NameDescription
T Type comparable with the key type, used for the lookup.
key The key to look for.

Returns

true if key exists in the hash table, false otherwise.

Example

HashTable!(string, int) hashTable;

assert("Shantungosaurus" !in hashTable);
hashTable["Shantungosaurus"] = 15;
assert("Shantungosaurus" in hashTable);

assert("Ceratopsia" !in hashTable);