|
|
using | underlying_type = std::set< Key, Compare, Allocator > |
| | Underlying ordered unique-key container type.
|
| |
|
using | key_type = typename underlying_type::key_type |
| | Key type used to order and identify elements.
|
| |
|
using | value_type = typename underlying_type::value_type |
| | Stored value type, identical to key_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 values.
|
| |
|
using | allocator_type = typename underlying_type::allocator_type |
| | Allocator type used to manage nodes.
|
| |
|
using | reference = typename underlying_type::reference |
| | Stored-value reference type.
|
| |
|
using | const_reference = typename underlying_type::const_reference |
| | Immutable stored-value reference type.
|
| |
|
using | pointer = typename underlying_type::pointer |
| | Stored-value pointer type.
|
| |
|
using | const_pointer = typename underlying_type::const_pointer |
| | Immutable stored-value pointer type.
|
| |
|
using | iterator = typename underlying_type::iterator |
| | Bidirectional iterator type.
|
| |
|
using | const_iterator = typename underlying_type::const_iterator |
| | Immutable bidirectional iterator type.
|
| |
|
using | reverse_iterator = typename underlying_type::reverse_iterator |
| | 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.
|
| |
|
|
| set ()=default |
| | Constructs an empty set.
|
| |
| | set (Compare const &comp, Allocator const &alloc=Allocator()) |
| | Constructs an empty set with a comparator and allocator.
|
| |
| | set (Allocator const &alloc) |
| | Constructs an empty set with an allocator.
|
| |
| template<typename InputIt> |
| | set (InputIt first, InputIt last, Compare const &comp=Compare(), Allocator const &alloc=Allocator()) |
| | Constructs a set from an iterator range.
|
| |
| template<typename InputIt> |
| | set (InputIt first, InputIt last, Allocator const &alloc) |
| | Constructs a set from an iterator range and allocator.
|
| |
| | set (std::initializer_list< value_type > init, Compare const &comp=Compare(), Allocator const &alloc=Allocator()) |
| | Constructs a set from an initializer list.
|
| |
| | set (std::initializer_list< value_type > init, Allocator const &alloc) |
| | Constructs a set from an initializer list and allocator.
|
| |
|
| set (set const &)=default |
| | Copy-constructs a set.
|
| |
|
| set (set &&) noexcept(std::is_nothrow_move_constructible_v< underlying_type >)=default |
| | Move-constructs a set.
|
| |
| | set (set const &other, Allocator const &alloc) |
| | Copy-constructs a set using the specified allocator.
|
| |
| | set (set &&other, Allocator const &alloc) |
| | Move-constructs a set using the specified allocator.
|
| |
| set & | operator= (set const &)=default |
| | Copy-assigns another set.
|
| |
| set & | operator= (set &&) noexcept(std::is_nothrow_move_assignable_v< underlying_type >)=default |
| | Move-assigns another set.
|
| |
| set & | 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 set.
|
| |
| iterator | begin () noexcept |
| | Returns an iterator to the first element.
|
| |
| const_iterator | begin () const noexcept |
| | Returns an immutable iterator to the first element.
|
| |
| const_iterator | cbegin () const noexcept |
| | Returns an immutable iterator to the first element.
|
| |
| iterator | end () noexcept |
| | Returns an iterator one past the final element.
|
| |
| const_iterator | end () const noexcept |
| | Returns an immutable iterator one past the final element.
|
| |
| const_iterator | cend () const noexcept |
| | Returns an immutable iterator one past the final element.
|
| |
| reverse_iterator | rbegin () noexcept |
| | Returns a reverse iterator to the final element.
|
| |
| const_reverse_iterator | rbegin () const noexcept |
| | Returns an immutable reverse iterator to the final element.
|
| |
| const_reverse_iterator | crbegin () const noexcept |
| | Returns an immutable reverse iterator to the final element.
|
| |
| reverse_iterator | rend () noexcept |
| | Returns a reverse iterator preceding the first element.
|
| |
| const_reverse_iterator | rend () const noexcept |
| | Returns an immutable reverse iterator preceding the first element.
|
| |
| const_reverse_iterator | crend () const noexcept |
| | Returns an immutable reverse iterator preceding the first element.
|
| |
| bool | empty () const noexcept |
| | Returns whether the set has no elements.
|
| |
| size_type | size () const noexcept |
| | Returns the number of stored elements.
|
| |
| size_type | max_size () const noexcept |
| | Returns the maximum number of elements supported by the implementation.
|
| |
|
void | clear () noexcept |
| | Removes all elements.
|
| |
| std::pair< iterator, bool > | insert (value_type const &value) |
| | Inserts a copied value if absent.
|
| |
| std::pair< iterator, bool > | insert (value_type &&value) |
| | Inserts a moved value if absent.
|
| |
| iterator | insert (const_iterator hint, value_type const &value) |
| | Inserts a copied value using an ordering hint.
|
| |
| iterator | insert (const_iterator hint, value_type &&value) |
| | Inserts a moved value using an ordering hint.
|
| |
| template<typename InputIt> |
| void | insert (InputIt first, InputIt last) |
| | Inserts an iterator range.
|
| |
| void | insert (std::initializer_list< value_type > init) |
| | Inserts values from an initializer list.
|
| |
| insert_return_type | insert (node_type &&node) |
| | Inserts an extracted node if 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 value in place if absent.
|
| |
| template<typename... Args> |
| iterator | emplace_hint (const_iterator hint, Args &&... args) |
| | Constructs a value in place 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_type const &key) |
| | Erases an element by key.
|
| |
| void | swap (set &other) noexcept(noexcept(m_set.swap(other.m_set))) |
| | Exchanges contents with another set.
|
| |
| node_type | extract (const_iterator pos) |
| | Removes an element without destroying it.
|
| |
| node_type | extract (key_type const &key) |
| | Removes an element by key without destroying it.
|
| |
| template<typename C2> |
| void | merge (set< Key, C2, Allocator > &source) |
| | Transfers non-duplicate nodes from another RPNX set.
|
| |
| template<typename C2> |
| void | merge (set< Key, C2, Allocator > &&source) |
| | Transfers non-duplicate nodes from another RPNX set.
|
| |
| template<typename C2> |
| void | merge (std::set< Key, C2, Allocator > &source) |
| | Transfers non-duplicate nodes from a standard set.
|
| |
| template<typename C2> |
| void | merge (std::set< Key, C2, Allocator > &&source) |
| | Transfers non-duplicate nodes from a standard set.
|
| |
| size_type | count (key_type const &key) const |
| | Counts elements matching a key.
|
| |
| iterator | find (key_type const &key) |
| | Finds an element by key.
|
| |
| const_iterator | find (key_type const &key) const |
| | Finds an element by key.
|
| |
| bool | contains (key_type const &key) const |
| | Tests whether a key is present.
|
| |
| std::pair< iterator, iterator > | equal_range (key_type const &key) |
| | Finds the range matching a key.
|
| |
| std::pair< const_iterator, const_iterator > | equal_range (key_type const &key) const |
| | Finds the range matching a key.
|
| |
| iterator | lower_bound (key_type const &key) |
| | Finds the first element not ordered before a key.
|
| |
| const_iterator | lower_bound (key_type const &key) const |
| | Finds the first element not ordered before a key.
|
| |
| iterator | upper_bound (key_type const &key) |
| | Finds the first element ordered after a key.
|
| |
| const_iterator | upper_bound (key_type 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 Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
class rpnx::set< Key, Compare, Allocator >
Ordered unique-key container with size-first ordering.
rpnx::set is currently implemented as a wrapper around std::set and exposes the same common container operations. Its relational comparisons differ from std::set: a set with fewer elements compares less than a set with more elements, regardless of the stored values. Sets with equal sizes compare lexicographically by iterator order.
- Template Parameters
-
| Key | Stored key type. |
| Compare | Ordering predicate used by the underlying std::set. |
| Allocator | Allocator used by the underlying std::set. |