|
bool | contains_key (const K &key) const |
| checks if a key exists in the hash map More...
|
|
V & | operator[] (const K &key) |
| get left-value reference to the value held by a key More...
|
|
const V & | operator[] (const K &key) const |
| get right-value reference to the value held by a key More...
|
|
void | remove_key (const K &key) |
| removes key from the hash map More...
|
|
int | size () const |
|
void | clear () |
|
| HashMap (const HashMap< K, V, H, S > &other) |
|
| HashMap (HashMap< K, V, H, S > &&other) |
|
HashMap< K, V, H, S > & | operator= (const HashMap< K, V, H, S > &other) |
|
HashMap< K, V, H, S > & | operator= (HashMap< K, V, H, S > &&other) |
|
iterator | begin () |
|
iterator | end () |
|
template<typename K, typename V, int(*)(const K &) H = default_hash<K, 128>, int S = 128>
class DSC::HashMap< K, V, H, S >
Generic hash map.
- Template Parameters
-
K | type of keys |
V | type of values |
H | hash function for keys |
S | hash container size (H(k) maps k to 0..S-1) |
template<typename K , typename V , int(*)(const K &) H, int S>
get left-value reference to the value held by a key
- Parameters
-
- Returns
- value of the key
if the key does not exist, it is created automatically
template<typename K , typename V , int(*)(const K &) H, int S>
void DSC::HashMap< K, V, H, S >::remove_key |
( |
const K & |
key | ) |
|
removes key from the hash map
- Parameters
-
if key doesn't exist, it is simply ignored