Member | Description |
---|---|
std::pair<iterator, bool>insert(const value_type& x) |
Constructs copy of x and attempts to insert it into the map. If the attempt fails because an item with the same key already exists, this copy is destroyed. Returns: std::pair(iterator,success). The value iterator points to an item in the map with a matching key. The value of success is true if the item was inserted; false otherwise. |
iterator insert(const_iterator hint, const value_type& x) |
Same as insert(x). NoteThe current implementation ignores the hint argument. Other implementations might not ignore it. It exists for similarity with the C++11 class unordered_map. It hints to the implementation about where to start searching. Typically it should point to an item adjacent to where the item will be inserted. Returns: Iterator pointing to inserted item, or item already in the map with the same key. |
std::pair<iterator, bool> insert(value_type&& x) |
Supported since C++11. Moves x into new instance of value_type and attempts to insert it into the set. If the attempt fails because an item with the same key already exists, this instance is destroyed. Returns: the same as insert(const value_type& x) version. |
iterator insert(const_iterator hint, value_type&& x) |
Same as insert(x). NoteThe current implementation ignores the hint argument. Other implementations might not ignore it. It exists for similarity with the C++11 classes unordered_set and unordered_multiset. It hints to the implementation about where to start searching. Typically it should point to an item adjacent to where the item will be inserted. Returns: the same as insert(const_iterator hint, const value_type& x) version. |
template<class InputIterator> void insert(InputIterator first, InputIterator last) |
Does insert(*i) wherei is in the half-open interval [first,last). |
void insert(std::initializer_list<value_type> il) |
Supported since C++11. Inserts a sequence to the map inserting each element from the initializer list. |
template<typename... Args> std::pair<iterator, bool> emplace(Args&&... args); |
Supported since C++11. Constructs new instance of value_type from args and attempts to insert it into the set. If the attempt fails because an item with the same key already exists, this instance is destroyed. Returns: the same as insert(const value_type& x) version. |
template<typename... Args> iterator emplace_hint(const_iterator hint, Args&&... args); |
Same as emplace(args). NoteThe current implementation ignores the hint argument. Other implementations might not ignore it. It exists for similarity with the C++11 classes unordered_set and unordered_multiset. It hints to the implementation about where to start searching. Typically it should point to an item adjacent to where the item will be inserted. Returns: Iterator pointing to inserted item, or item already in the set with the same key. |
iterator unsafe_erase(const_iterator position) |
Removes the item pointed to by position from the map. Returns: Iterator pointing to item that was immediately after the erased item, or end() if erased item was the last item in the map. |
size_type unsafe_erase(const key_type& k) |
Removes item with key k if such an item exists. Returns: 1 if an item was removed; 0 otherwise. |
iterator unsafe_erase(const_iterator first, const_iterator last) |
Removes *i where i is in the half-open interval [first,last). Returns: last |
void clear() |
Remove all items from the map. |
Member | Description |
---|---|
void swap(concurrent_unordered_map& m) |
Swaps contents of *this and m. |
Member | Description |
---|---|
void swap(concurrent_unordered_multimap& m) |
Swaps contents of *this and m. |