Class DenseHashTable
Hashtable class, used to implement the hashed associative containers hash_set and hash_map.
class DenseHashTable(Value, Key, HashFcn, ExtractKey, SetKey, EqualKey)
;
Parameters
Name | Description |
---|---|
Value | what is stored in the table (each bucket is a Value). |
Key | something in a 1-to-1 correspondence to a Value, that can be used to search for a Value in the table (find() takes a Key). |
HashFcn | A callable type which when given a Key, returns an integer, the more unique the better. |
ExtractKey | A callable type which when given a Value, returns the unique Key associated with it. Must inherit from unary_function, or at least have a result_type enum indicating the return type of operator(). |
SetKey | A callable type which when given a ref Value and a Key, modifies the value such that ExtractKey(value) == key. We guarantee this is only called with key == deleted_key or key == empty_key. |
EqualKey | A callable type which when given two Keys, says whether they are the same (that is, if they are both associated with the same Value). |