#include <bn_unordered_map.h>
template<typename Key, typename Value, typename KeyHash = hash<Key>, typename KeyEqual = equal_ to<Key>>
iunordered_map class
Base class of bn::
Template parameters | |
---|---|
Key | Key type. |
Value | Value type. |
KeyHash | Functor used to calculate the hash of a given key. |
KeyEqual | Functor used for all key comparisons. |
Can be used as a reference type for all bn::
Unlike std::unordered_map
, it doesn't offer pointer stability when moving or erasing elements.
Derived classes
-
template<typename Key, typename Value, int MaxSize, typename KeyHash = hash<Key>, typename KeyEqual = equal_class unordered_map
to<Key>> std::unordered_map
like container with a fixed size buffer.
Public types
- class const_iterator
- Const iterator.
- class iterator
- Non const iterator.
- using key_type = Key
- Key type alias.
- using mapped_type = Value
- Value type alias.
-
using value_type = pair<const key_
type, mapped_ type> - (Key, Value) pair type alias.
- using size_type = int
- Size type alias.
- using difference_type = int
- Difference type alias.
- using hash_type = unsigned
- Hash type alias.
- using hasher = KeyHash
- Hash functor alias.
- using key_equal = KeyEqual
- Equality functor alias.
-
using reference = value_
type& - (Key, Value) pair reference alias.
-
using const_reference = const value_
type& - (Key, Value) pair const reference alias.
-
using pointer = value_
type* - (Key, Value) pair pointer alias.
-
using const_pointer = const value_
type* - (Key, Value) pair const pointer alias.
- using reverse_iterator = bn::reverse_iterator<iterator>
- Reverse iterator alias.
-
using const_reverse_iterator = bn::reverse_iterator<const_
iterator> - Const reverse iterator alias.
Constructors, destructors, conversion operators
- ~iunordered_map() defaulted noexcept
- Destructor.
- ~iunordered_map() noexcept
- Destructor.
Public functions
-
auto operator=(const iunordered_
map& other) -> iunordered_ map& - Copy assignment operator.
-
auto operator=(iunordered_
map&& other) -> iunordered_ map& noexcept - Move assignment operator.
-
auto size() const -> size_
type - Returns the current size.
-
auto max_size() const -> size_
type - Returns the maximum possible size.
-
auto available() const -> size_
type - Returns the remaining capacity.
- auto empty() const -> bool
- Indicates if it doesn't contain any element.
- auto full() const -> bool
- Indicates if it can't contain any more elements.
-
auto begin() const -> const_
iterator - Returns a const iterator to the beginning of the iunordered_
map. - auto begin() -> iterator
- Returns an iterator to the beginning of the iunordered_
map. -
auto end() const -> const_
iterator - Returns a const iterator to the end of the iunordered_
map. - auto end() -> iterator
- Returns an iterator to the end of the iunordered_
map. -
auto cbegin() const -> const_
iterator - Returns a const iterator to the beginning of the iunordered_
map. -
auto cend() const -> const_
iterator - Returns a const iterator to the end of the iunordered_
map. -
auto rbegin() const -> const_
reverse_ iterator - Returns a const reverse iterator to the end of the iunordered_
map. -
auto rbegin() -> reverse_
iterator - Returns a reverse iterator to the end of the iunordered_
map. -
auto rend() const -> const_
reverse_ iterator - Returns a const reverse iterator to the beginning of the iunordered_
map. -
auto rend() -> reverse_
iterator - Returns a reverse iterator to the beginning of the iunordered_
map. -
auto crbegin() const -> const_
reverse_ iterator - Returns a const reverse iterator to the end of the iunordered_
map. -
auto crend() const -> const_
reverse_ iterator - Returns a const reverse iterator to the beginning of the iunordered_
map. -
auto contains(const key_
type& key) const -> bool - Indicates if the specified key is contained in this iunordered_
map. -
auto contains_hash(hash_
type key_hash, const key_ type& key) const -> bool - Indicates if the specified key is contained in this iunordered_
map. -
auto count(const key_
type& key) const -> size_ type - Counts the number of keys stored in this iunordered_
map are equal to the given one. -
auto count_hash(hash_
type key_hash, const key_ type& key) const -> size_ type - Counts the number of keys stored in this iunordered_
map are equal to the given one. -
auto find(const key_
type& key) const -> const_ iterator - Searches for a given key.
-
auto find(const key_
type& key) -> iterator - Searches for a given key.
-
auto find_hash(hash_
type key_hash, const key_ type& key) const -> const_ iterator - Searches for a given key.
-
auto find_hash(hash_
type key_hash, const key_ type& key) -> iterator - Searches for a given key.
-
auto at(const key_
type& key) const -> const mapped_ type& - Searches for a given key.
-
auto at(const key_
type& key) -> mapped_ type& - Searches for a given key.
-
auto at_hash(hash_
type key_hash, const key_ type& key) const -> const mapped_ type& - Searches for a given key.
-
auto at_hash(hash_
type key_hash, const key_ type& key) -> mapped_ type& - Searches for a given key.
-
auto insert(const value_
type& value) -> iterator - Inserts a copy of the given (Key, Value) pair.
-
auto insert(value_
type&& value) -> iterator - Inserts a moved (Key, Value) pair.
-
auto insert(const key_
type& key, const mapped_ type& mapped_value) -> iterator - Inserts a copy of the given (Key, Value) pair.
-
auto insert(const key_
type& key, mapped_ type&& mapped_value) -> iterator - Inserts a moved (Key, Value) pair.
-
auto insert_hash(hash_
type key_hash, const value_ type& value) -> iterator - Inserts a copy of the given (Key, Value) pair.
-
auto insert_hash(hash_
type key_hash, value_ type&& value) -> iterator - Inserts a moved (Key, Value) pair.
-
auto insert_hash(hash_
type key_hash, const key_ type& key, const mapped_ type& mapped_value) -> iterator - Inserts a copy of the given (Key, Value) pair.
-
auto insert_hash(hash_
type key_hash, const key_ type& key, mapped_ type&& mapped_value) -> iterator - Inserts a moved (Key, Value) pair.
-
auto insert_or_assign(const value_
type& value) -> iterator - Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign(value_
type&& value) -> iterator - Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign(const key_
type& key, const mapped_ type& mapped_value) -> iterator - Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign(const key_
type& key, mapped_ type&& mapped_value) -> iterator - Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign_hash(hash_
type key_hash, const value_ type& value) -> iterator - Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign_hash(hash_
type key_hash, value_ type&& value) -> iterator - Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign_hash(hash_
type key_hash, const key_ type& key, const mapped_ type& mapped_value) -> iterator - Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
-
auto insert_or_assign_hash(hash_
type key_hash, const key_ type& key, mapped_ type&& mapped_value) -> iterator - Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
-
template<typename... Args>auto try_emplace(const key_
type& key, Args && ... args) -> iterator - Inserts in-place a (Key, Value) pair if the given key does not exist.
-
template<typename... Args>auto try_emplace_hash(hash_
type key_hash, const key_ type& key, Args && ... args) -> iterator - Inserts in-place a (Key, Value) pair if the given key does not exist.
-
auto erase(const const_
iterator& position) -> iterator - Erases an element.
-
auto erase(const key_
type& key) -> bool - Erases an element.
-
auto erase_hash(hash_
type key_hash, const key_ type& key) -> bool - Erases an element.
-
template<class Pred>auto erase_if(const Pred& pred) -> size_
type - Erases all elements that satisfy the specified predicate.
-
void merge(iunordered_
map&& other) noexcept - Moves all elements of the given iunordered_
map into this one, leaving the first one empty. - void clear()
- Removes all elements.
- void clear()
- Removes all elements.
-
auto operator[](const key_
type& key) -> mapped_ type& - Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
-
auto operator()(const key_
type& key) -> mapped_ type& - Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
-
auto operator()(hash_
type key_hash, const key_ type& key) -> mapped_ type& - Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
-
void swap(iunordered_
map& other) - Exchanges the contents of this iunordered_
map with those of the other one.
Friends
-
void swap(iunordered_
map& a, iunordered_ map& b) - Exchanges the contents of a iunordered_
map with those of another one. -
auto operator==(const iunordered_
map& a, const iunordered_ map& b) -> bool - Equal operator.
-
auto operator<(const iunordered_
map& a, const iunordered_ map& b) -> bool - Less than operator.
-
auto operator>(const iunordered_
map& a, const iunordered_ map& b) -> bool - Greater than operator.
-
auto operator<=(const iunordered_
map& a, const iunordered_ map& b) -> bool - Less than or equal operator.
-
auto operator>=(const iunordered_
map& a, const iunordered_ map& b) -> bool - Greater than or equal operator.
Function documentation
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iunordered_ map& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: operator=(const iunordered_ map& other)
Copy assignment operator.
Parameters | |
---|---|
other | iunordered_ |
Returns | Reference to this. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iunordered_ map& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: operator=(iunordered_ map&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | iunordered_ |
Returns | Reference to this. |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: contains(const key_ type& key) const
Indicates if the specified key is contained in this iunordered_
Parameters | |
---|---|
key | Key to search for. |
Returns | true if the specified key is contained in this iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: contains_hash(hash_ type key_hash,
const key_ type& key) const
Indicates if the specified key is contained in this iunordered_
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | true if the specified key is contained in this iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
size_ type bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: count(const key_ type& key) const
Counts the number of keys stored in this iunordered_
Parameters | |
---|---|
key | Key to search for. |
Returns | 1 if the specified key is contained in this iunordered_ |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
size_ type bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: count_hash(hash_ type key_hash,
const key_ type& key) const
Counts the number of keys stored in this iunordered_
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | 1 if the specified key is contained in this iunordered_ |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
const_ iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: find(const key_ type& key) const
Searches for a given key.
Parameters | |
---|---|
key | Key to search for. |
Returns | Const iterator to the (Key, Value) pair if it exists, otherwise end(). |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
const_ iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: find_hash(hash_ type key_hash,
const key_ type& key) const
Searches for a given key.
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | Const iterator to the (Key, Value) pair if it exists, otherwise end(). |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: find_hash(hash_ type key_hash,
const key_ type& key)
Searches for a given key.
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | Iterator to the (Key, Value) pair if it exists, otherwise end(). |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
const mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: at(const key_ type& key) const
Searches for a given key.
Parameters | |
---|---|
key | Key to search for. |
Returns | Const reference to the value stored with the specified key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: at(const key_ type& key)
Searches for a given key.
Parameters | |
---|---|
key | Key to search for. |
Returns | Reference to the value stored with the specified key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
const mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: at_hash(hash_ type key_hash,
const key_ type& key) const
Searches for a given key.
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | Const reference to the value stored with the specified key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: at_hash(hash_ type key_hash,
const key_ type& key)
Searches for a given key.
Parameters | |
---|---|
key_hash | Hash of the given key to search for. |
key | Key to search for. |
Returns | Reference to the value stored with the specified key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert(const value_ type& value)
Inserts a copy of the given (Key, Value) pair.
Parameters | |
---|---|
value | (Key, Value) pair to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert(value_ type&& value)
Inserts a moved (Key, Value) pair.
Parameters | |
---|---|
value | (Key, Value) pair to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert(const key_ type& key,
const mapped_ type& mapped_value)
Inserts a copy of the given (Key, Value) pair.
Parameters | |
---|---|
key | Key to insert. |
mapped_value | Value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert(const key_ type& key,
mapped_ type&& mapped_value)
Inserts a moved (Key, Value) pair.
Parameters | |
---|---|
key | Key to insert. |
mapped_value | Value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_hash(hash_ type key_hash,
const value_ type& value)
Inserts a copy of the given (Key, Value) pair.
Parameters | |
---|---|
key_hash | Hash of the key to insert. |
value | (Key, Value) pair to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_hash(hash_ type key_hash,
value_ type&& value)
Inserts a moved (Key, Value) pair.
Parameters | |
---|---|
key_hash | Hash of the key to insert. |
value | (Key, Value) pair to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_hash(hash_ type key_hash,
const key_ type& key,
const mapped_ type& mapped_value)
Inserts a copy of the given (Key, Value) pair.
Parameters | |
---|---|
key_hash | Hash of the key to insert. |
key | Key to insert. |
mapped_value | Value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_hash(hash_ type key_hash,
const key_ type& key,
mapped_ type&& mapped_value)
Inserts a moved (Key, Value) pair.
Parameters | |
---|---|
key_hash | Hash of the key to insert. |
key | Key to insert. |
mapped_value | Value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign(const value_ type& value)
Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
value | (Key, Value) pair to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign(value_ type&& value)
Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
value | (Key, Value) pair to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign(const key_ type& key,
const mapped_ type& mapped_value)
Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key | Key to insert or assign. |
mapped_value | Value to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign(const key_ type& key,
mapped_ type&& mapped_value)
Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key | Key to insert or assign. |
mapped_value | Value to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign_hash(hash_ type key_hash,
const value_ type& value)
Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key_hash | Hash of the key to insert or assign. |
value | (Key, Value) pair to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign_hash(hash_ type key_hash,
value_ type&& value)
Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key_hash | Hash of the key to insert or assign. |
value | (Key, Value) pair to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign_hash(hash_ type key_hash,
const key_ type& key,
const mapped_ type& mapped_value)
Inserts a copy of the given (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key_hash | Hash of the key to insert or assign. |
key | Key to insert or assign. |
mapped_value | Value to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: insert_or_assign_hash(hash_ type key_hash,
const key_ type& key,
mapped_ type&& mapped_value)
Inserts a moved (Key, Value) pair or replaces the value with the given one if the key is found.
Parameters | |
---|---|
key_hash | Hash of the key to insert or assign. |
key | Key to insert or assign. |
mapped_value | Value to insert or assign. |
Returns | Iterator pointing to the inserted or assigned (Key, Value) pair. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
template<typename... Args>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: try_emplace(const key_ type& key,
Args && ... args)
Inserts in-place a (Key, Value) pair if the given key does not exist.
Parameters | |
---|---|
key | Key to insert. |
args | Parameters of the value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair if the key does not exist, otherwise end(). |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
template<typename... Args>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: try_emplace_hash(hash_ type key_hash,
const key_ type& key,
Args && ... args)
Inserts in-place a (Key, Value) pair if the given key does not exist.
Parameters | |
---|---|
key_hash | Hash of the key to insert. |
key | Key to insert. |
args | Parameters of the value to insert. |
Returns | Iterator pointing to the inserted (Key, Value) pair if the key does not exist, otherwise end(). |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
iterator bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: erase(const const_ iterator& position)
Erases an element.
Parameters | |
---|---|
position | Iterator to the element to erase. |
Returns | Iterator following the erased element. |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: erase(const key_ type& key)
Erases an element.
Parameters | |
---|---|
key | Key to erase. |
Returns | true if the elements was erased, otherwise false . |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: erase_hash(hash_ type key_hash,
const key_ type& key)
Erases an element.
Parameters | |
---|---|
key_hash | Hash of the key to erase. |
key | Key to erase. |
Returns | true if the elements was erased, otherwise false . |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
template<class Pred>
size_ type bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: erase_if(const Pred& pred)
Erases all elements that satisfy the specified predicate.
Parameters | |
---|---|
pred | Unary predicate which returns true if the element should be erased. |
Returns | Number of erased elements. |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
void bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: merge(iunordered_ map&& other) noexcept
Moves all elements of the given iunordered_
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: operator[](const key_ type& key)
Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
Parameters | |
---|---|
key | Key to search for. |
Returns | Reference to the value that is mapped to the given key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: operator()(const key_ type& key)
Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
Parameters | |
---|---|
key | Key to search for. |
Returns | Reference to the value that is mapped to the given key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
mapped_ type& bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: operator()(hash_ type key_hash,
const key_ type& key)
Returns a reference to the value that is mapped to the given key, performing an insertion if such key does not already exist.
Parameters | |
---|---|
key_hash | Hash of the key to search for. |
key | Key to search for. |
Returns | Reference to the value that is mapped to the given key. |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
void bn:: iunordered_map<Key, Value, KeyHash, KeyEqual>:: swap(iunordered_ map& other)
Exchanges the contents of this iunordered_
Parameters | |
---|---|
other | iunordered_ |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
void swap(iunordered_ map& a,
iunordered_ map& b)
Exchanges the contents of a iunordered_
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Unlike std::unordered_map
, it doesn't offer pointer stability.
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool operator==(const iunordered_ map& a,
const iunordered_ map& b)
Equal operator.
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Returns | true if the first iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool operator<(const iunordered_ map& a,
const iunordered_ map& b)
Less than operator.
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Returns | true if the first iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool operator>(const iunordered_ map& a,
const iunordered_ map& b)
Greater than operator.
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Returns | true if the first iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool operator<=(const iunordered_ map& a,
const iunordered_ map& b)
Less than or equal operator.
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Returns | true if the first iunordered_false . |
template<typename Key, typename Value, typename KeyHash, typename KeyEqual>
bool operator>=(const iunordered_ map& a,
const iunordered_ map& b)
Greater than or equal operator.
Parameters | |
---|---|
a | First iunordered_ |
b | Second iunordered_ |
Returns | true if the first iunordered_false . |