|
|
using | underlying_type = std::map< Key, T, Compare, Allocator > |
| | Underlying ordered associative container type.
|
| |
|
using | key_type = typename underlying_type::key_type |
| | Key type used to order and identify elements.
|
| |
|
using | mapped_type = typename underlying_type::mapped_type |
| | Value associated with each key.
|
| |
|
using | value_type = typename underlying_type::value_type |
| | Stored key-value pair type.
|
| |
|
using | size_type = typename underlying_type::size_type |
| | Unsigned type used for element counts.
|
| |
|
using | difference_type = typename underlying_type::difference_type |
| | Signed type used for iterator distances.
|
| |
|
using | key_compare = typename underlying_type::key_compare |
| | Function object used to order keys.
|
| |
|
using | value_compare = typename underlying_type::value_compare |
| | Function object used to order stored key-value pairs by key.
|
| |
|
using | allocator_type = typename underlying_type::allocator_type |
| | Allocator type used to manage nodes.
|
| |
|
using | reference = typename underlying_type::reference |
| | Mutable stored-value reference type.
|
| |
|
using | const_reference = typename underlying_type::const_reference |
| | Immutable stored-value reference type.
|
| |
|
using | pointer = typename underlying_type::pointer |
| | Mutable stored-value pointer type.
|
| |
|
using | const_pointer = typename underlying_type::const_pointer |
| | Immutable stored-value pointer type.
|
| |
|
using | iterator = typename underlying_type::iterator |
| | Mutable bidirectional iterator type.
|
| |
|
using | const_iterator = typename underlying_type::const_iterator |
| | Immutable bidirectional iterator type.
|
| |
|
using | reverse_iterator = typename underlying_type::reverse_iterator |
| | Mutable reverse-iterator type.
|
| |
|
using | const_reverse_iterator = typename underlying_type::const_reverse_iterator |
| | Immutable reverse-iterator type.
|
| |
|
using | node_type = typename underlying_type::node_type |
| | Owning handle for an extracted node.
|
| |
|
using | insert_return_type = typename underlying_type::insert_return_type |
| | Result returned when inserting a node handle without a hint.
|
| |
|
|
| map ()=default |
| | Constructs an empty map.
|
| |
| | map (Compare const &comp, Allocator const &alloc=Allocator()) |
| | Constructs an empty map with a comparator and allocator.
|
| |
| | map (Allocator const &alloc) |
| | Constructs an empty map with an allocator.
|
| |
| template<typename InputIt> |
| | map (InputIt first, InputIt last, Compare const &comp=Compare(), Allocator const &alloc=Allocator()) |
| | Constructs a map from an iterator range.
|
| |
| template<typename InputIt> |
| | map (InputIt first, InputIt last, Allocator const &alloc) |
| | Constructs a map from an iterator range and allocator.
|
| |
| | map (std::initializer_list< value_type > init, Compare const &comp=Compare(), Allocator const &alloc=Allocator()) |
| | Constructs a map from an initializer list.
|
| |
| | map (std::initializer_list< value_type > init, Allocator const &alloc) |
| | Constructs a map from an initializer list and allocator.
|
| |
|
| map (map const &)=default |
| | Copy-constructs a map.
|
| |
|
| map (map &&) noexcept(std::is_nothrow_move_constructible_v< underlying_type >)=default |
| | Move-constructs a map.
|
| |
| | map (map const &other, Allocator const &alloc) |
| | Copy-constructs a map using the specified allocator.
|
| |
| | map (map &&other, Allocator const &alloc) |
| | Move-constructs a map using the specified allocator.
|
| |
| map & | operator= (map const &)=default |
| | Copy-assigns another map.
|
| |
| map & | operator= (map &&) noexcept(std::is_nothrow_move_assignable_v< underlying_type >)=default |
| | Move-assigns another map.
|
| |
| map & | operator= (std::initializer_list< value_type > init) |
| | Replaces the contents with an initializer list.
|
| |
| allocator_type | get_allocator () const noexcept |
| | Returns the allocator used by this map.
|
| |
| T & | at (Key const &key) |
| | Returns the mapped value for an existing key.
|
| |
| T const & | at (Key const &key) const |
| | Returns the mapped value for an existing key.
|
| |
| T & | operator[] (Key const &key) |
| | Returns the mapped value, inserting a default value when absent.
|
| |
| T & | operator[] (Key &&key) |
| | Returns the mapped value, moving the key into a new element when absent.
|
| |
| iterator | begin () noexcept |
| | Returns an iterator to the first key-value pair.
|
| |
| const_iterator | begin () const noexcept |
| | Returns an immutable iterator to the first key-value pair.
|
| |
| const_iterator | cbegin () const noexcept |
| | Returns an immutable iterator to the first key-value pair.
|
| |
| iterator | end () noexcept |
| | Returns an iterator one past the final key-value pair.
|
| |
| const_iterator | end () const noexcept |
| | Returns an immutable iterator one past the final key-value pair.
|
| |
| const_iterator | cend () const noexcept |
| | Returns an immutable iterator one past the final key-value pair.
|
| |
| reverse_iterator | rbegin () noexcept |
| | Returns a reverse iterator to the final key-value pair.
|
| |
| const_reverse_iterator | rbegin () const noexcept |
| | Returns an immutable reverse iterator to the final key-value pair.
|
| |
| const_reverse_iterator | crbegin () const noexcept |
| | Returns an immutable reverse iterator to the final key-value pair.
|
| |
| reverse_iterator | rend () noexcept |
| | Returns a reverse iterator preceding the first key-value pair.
|
| |
| const_reverse_iterator | rend () const noexcept |
| | Returns an immutable reverse iterator preceding the first key-value pair.
|
| |
| const_reverse_iterator | crend () const noexcept |
| | Returns an immutable reverse iterator preceding the first key-value pair.
|
| |
| bool | empty () const noexcept |
| | Returns whether the map has no elements.
|
| |
| size_type | size () const noexcept |
| | Returns the number of stored key-value pairs.
|
| |
| size_type | max_size () const noexcept |
| | Returns the maximum number of elements supported by the implementation.
|
| |
|
void | clear () noexcept |
| | Removes all key-value pairs.
|
| |
| std::pair< iterator, bool > | insert (value_type const &value) |
| | Inserts a key-value pair if its key is absent.
|
| |
| std::pair< iterator, bool > | insert (value_type &&value) |
| | Inserts a key-value pair by moving it if its key is absent.
|
| |
template<typename P>
requires std::is_constructible_v< value_type, P&& > |
| std::pair< iterator, bool > | insert (P &&value) |
| | Inserts a value constructible as a key-value pair if its key is absent.
|
| |
| iterator | insert (const_iterator hint, value_type const &value) |
| | Inserts a copied key-value pair using an ordering hint.
|
| |
| iterator | insert (const_iterator hint, value_type &&value) |
| | Inserts a moved key-value pair using an ordering hint.
|
| |
template<typename P>
requires std::is_constructible_v< value_type, P&& > |
| iterator | insert (const_iterator hint, P &&value) |
| | Inserts a pair-like value using an ordering hint.
|
| |
| template<typename InputIt> |
| void | insert (InputIt first, InputIt last) |
| | Inserts every key-value pair in an iterator range.
|
| |
| void | insert (std::initializer_list< value_type > init) |
| | Inserts key-value pairs from an initializer list.
|
| |
| insert_return_type | insert (node_type &&node) |
| | Inserts an extracted node if its key is absent.
|
| |
| iterator | insert (const_iterator hint, node_type &&node) |
| | Inserts an extracted node using an ordering hint.
|
| |
| template<typename... Args> |
| std::pair< iterator, bool > | emplace (Args &&... args) |
| | Constructs a key-value pair in place if its key is absent.
|
| |
| template<typename... Args> |
| iterator | emplace_hint (const_iterator hint, Args &&... args) |
| | Constructs a key-value pair in place using an ordering hint.
|
| |
| template<typename... Args> |
| std::pair< iterator, bool > | try_emplace (Key const &key, Args &&... args) |
| | Constructs a mapped value only when a copied key is absent.
|
| |
| template<typename... Args> |
| std::pair< iterator, bool > | try_emplace (Key &&key, Args &&... args) |
| | Constructs a mapped value only when a moved key is absent.
|
| |
| template<typename... Args> |
| iterator | try_emplace (const_iterator hint, Key const &key, Args &&... args) |
| | Constructs a mapped value for an absent copied key using an ordering hint.
|
| |
| template<typename... Args> |
| iterator | try_emplace (const_iterator hint, Key &&key, Args &&... args) |
| | Constructs a mapped value for an absent moved key using an ordering hint.
|
| |
| template<typename M> |
| std::pair< iterator, bool > | insert_or_assign (Key const &key, M &&obj) |
| | Inserts a copied key or assigns its existing mapped value.
|
| |
| template<typename M> |
| std::pair< iterator, bool > | insert_or_assign (Key &&key, M &&obj) |
| | Inserts a moved key or assigns its existing mapped value.
|
| |
| template<typename M> |
| iterator | insert_or_assign (const_iterator hint, Key const &key, M &&obj) |
| | Inserts a copied key or assigns its value using an ordering hint.
|
| |
| template<typename M> |
| iterator | insert_or_assign (const_iterator hint, Key &&key, M &&obj) |
| | Inserts a moved key or assigns its value using an ordering hint.
|
| |
| iterator | erase (const_iterator pos) |
| | Erases one element.
|
| |
| iterator | erase (const_iterator first, const_iterator last) |
| | Erases a range.
|
| |
| size_type | erase (Key const &key) |
| | Erases the element with a key.
|
| |
| void | swap (map &other) noexcept(noexcept(m_map.swap(other.m_map))) |
| | Exchanges contents with another map.
|
| |
| node_type | extract (const_iterator pos) |
| | Removes an element without destroying it.
|
| |
| node_type | extract (Key const &key) |
| | Removes an element by key without destroying it.
|
| |
| template<typename C2> |
| void | merge (map< Key, T, C2, Allocator > &source) |
| | Transfers non-duplicate nodes from another RPNX map.
|
| |
| template<typename C2> |
| void | merge (map< Key, T, C2, Allocator > &&source) |
| | Transfers non-duplicate nodes from another RPNX map.
|
| |
| template<typename C2> |
| void | merge (std::map< Key, T, C2, Allocator > &source) |
| | Transfers non-duplicate nodes from a standard map.
|
| |
| template<typename C2> |
| void | merge (std::map< Key, T, C2, Allocator > &&source) |
| | Transfers non-duplicate nodes from a standard map.
|
| |
| size_type | count (Key const &key) const |
| | Counts elements matching a key.
|
| |
| iterator | find (Key const &key) |
| | Finds an element by key.
|
| |
| const_iterator | find (Key const &key) const |
| | Finds an element by key.
|
| |
| bool | contains (Key const &key) const |
| | Tests whether a key is present.
|
| |
| std::pair< iterator, iterator > | equal_range (Key const &key) |
| | Finds the range matching a key.
|
| |
| std::pair< const_iterator, const_iterator > | equal_range (Key const &key) const |
| | Finds the range matching a key.
|
| |
| iterator | lower_bound (Key const &key) |
| | Finds the first element not ordered before a key.
|
| |
| const_iterator | lower_bound (Key const &key) const |
| | Finds the first element not ordered before a key.
|
| |
| iterator | upper_bound (Key const &key) |
| | Finds the first element ordered after a key.
|
| |
| const_iterator | upper_bound (Key const &key) const |
| | Finds the first element ordered after a key.
|
| |
| key_compare | key_comp () const |
| | Returns the key-ordering predicate.
|
| |
| value_compare | value_comp () const |
| | Returns the stored-value ordering predicate.
|
| |
template<typename Key, typename T, typename Compare = std::less< Key >, typename Allocator = std::allocator< std::pair< Key const, T > >>
class rpnx::map< Key, T, Compare, Allocator >
Ordered key-value container with size-first ordering.
rpnx::map is currently implemented as a wrapper around std::map and exposes the same common container operations. Its relational comparisons differ from std::map: a map with fewer elements compares less than a map with more elements, regardless of the stored key-value pairs. Maps with equal sizes compare through the underlying std::map.
- Template Parameters
-
| Key | Stored key type. |
| T | Stored mapped value type. |
| Compare | Ordering predicate used by the underlying std::map. |
| Allocator | Allocator used by the underlying std::map. |