An associative array of key-value pairs that are organized in a Hashtable .
The elements need not be ordered, but you must be able to compare them for equality ( EqualTo ) or other equality-like relation provided as the fourth template argument.
The third template argument is a hash function object that is by default the Hasher function object that delegates the computation of the hash function for the element to one of the GetHashCode function overloads. If there is not a GetHashCode overload for the your element type, you can provide your own, and it should work with the standard Hasher .
Adding an element to the hash map depends on the hash function, but can be thought as O(1) operation. Searching for an element in a hash map depends on the hash function, but can be thought as O(1) operation.
Model of ForwardContainer .
K | |
T | |
H | Hasher<K> |
C | EqualTo<K> |
public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | Begin() |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | Begin() const |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | CBegin() const |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | CEnd() const |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | CFind(const K& key) const |
public inline nothrow void | Clear() |
public inline nothrow long | Count() const |
public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | End() |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | End() const |
public inline nothrow HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | Find(const K& key) |
public inline nothrow HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> | Find(const K& key) const |
public inline Pair<HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>>, bool> | Insert(const Pair<K, T>& value) |
public inline nothrow bool | IsEmpty() const |
public inline nothrow void | Remove(HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> pos) |
public inline nothrow void | Remove(const K& key) |
public inline T& | operator[](const K& key) |
public typedef Compare | C |
public typedef ConstIterator | HashtableIterator<Pair<K, T>, const Pair<K, T>&, const Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> |
public typedef HashFun | H |
public typedef Iterator | HashtableIterator<Pair<K, T>, Pair<K, T>&, Pair<K, T>*, Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C>> |
public typedef KeyType | K |
public typedef MappedType | T |
private typedef Self | HashMap |
private typedef TableType | Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C> |
public typedef ValueType | Pair<K, T> |
private Hashtable<K, Pair<K, T>, SelectFirst<K, T>, H, C> | table |