To jest stara wersja strony!
Opis kontenera hash_multmap
Autor: Grzegorz Mroziewicz
hash_multimap<Key, Data, HashFcn, EqualKey, Alloc>
Kontener hash_multimap jest mapą służącą do przechowywania par obiektów klucz-wartość.
Wartość klucza Key nie musi być unikalna. Kontener pozwala przechowywać wiele elementów o zadanym kluczu oraz udostępnia metody do
wyszukiwania i zliczania elementów o podanym kluczu. Wykorzystaniu funkcji mieszającej HashFcn pozwala osiągnąć lepszą złożoność czasową wyszukiwania elementów w mapie.
Typy :
Nazwa | Opis |
Key | Typ klucza dla pary elementów kontenera. |
Data | Typ wartości dla pary elementów kontenera. |
HashFcn | Funkcja mieszająca ( hash<Key> ). |
EqualKey | Funktor określający czy klucze są sobie równe ( equal_to<Key> ). |
Alloc | Allokator pamięci. |
Kontruktory
hash_multimap()
hash_multimap(size_type n)
hash_multimap(size_type n, const hasher& h)
hash_multimap(size_type n, const hasher& h, const key_equal& k)
hash_multimap(const hash_multimap&)
template <class InputIterator> hash_multimap(InputIterator, InputIterator)
template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n)
template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n, const hasher& h)
template <class InputIterator> hash_multimap(InputIterator, InputIterator, size_type n, const hasher& h, const key_equal& k)
Dodawanie elementów
iterator insert(const value_type& x)
template <class InputIterator> void insert(InputIterator, InputIterator);
Usuwanie elementów
Wyszukiwanie elementów
const_iterator find(const key_type& k) const
iterator find(const key_type& k)
pair<const_iterator, const_iterator> equal_range(const key_type& k) const
pair<iterator, iterator> equal_range(const key_type& k)
size_type count(const key_type& k) const
Parametry kontenera
Inne
Przykładowy program