RPNX::DataStructures
Header-only C++ data structures and supporting utilities.
Loading...
Searching...
No Matches
rpnx::set< Key, Compare, Allocator > Class Template Reference

Ordered unique-key container with size-first ordering. More...

#include <set.hpp>

Public Types

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.
 

Public Member Functions

 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.
 
setoperator= (set const &)=default
 Copy-assigns another set.
 
setoperator= (set &&) noexcept(std::is_nothrow_move_assignable_v< underlying_type >)=default
 Move-assigns another set.
 
setoperator= (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, iteratorequal_range (key_type const &key)
 Finds the range matching a key.
 
std::pair< const_iterator, const_iteratorequal_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.
 

Friends

template<typename K, typename C, typename A>
bool operator== (set< K, C, A > const &lhs, set< K, C, A > const &rhs)
 Grants equality comparison access to the underlying set.
 
template<typename K, typename C, typename A>
bool operator< (set< K, C, A > const &lhs, set< K, C, A > const &rhs)
 Grants less-than comparison access to the underlying set.
 
template<typename K, typename C, typename A>
auto operator<=> (set< K, C, A > const &lhs, set< K, C, A > const &rhs) -> decltype(std::declval< typename set< K, C, A >::underlying_type const & >()<=> std::declval< typename set< K, C, A >::underlying_type const & >())
 Grants three-way comparison access to the underlying set.
 

Detailed Description

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
KeyStored key type.
CompareOrdering predicate used by the underlying std::set.
AllocatorAllocator used by the underlying std::set.

Constructor & Destructor Documentation

◆ set() [1/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( Compare const & comp,
Allocator const & alloc = Allocator() )
inlineexplicit

Constructs an empty set with a comparator and allocator.

Parameters
compComparator used to order elements.
allocAllocator used to allocate elements.

◆ set() [2/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( Allocator const & alloc)
inlineexplicit

Constructs an empty set with an allocator.

Parameters
allocAllocator used to allocate elements.

◆ set() [3/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename InputIt>
rpnx::set< Key, Compare, Allocator >::set ( InputIt first,
InputIt last,
Compare const & comp = Compare(),
Allocator const & alloc = Allocator() )
inline

Constructs a set from an iterator range.

Template Parameters
InputItInput iterator type.
Parameters
firstFirst element in the source range.
lastOne-past-last element in the source range.
compComparator used to order elements.
allocAllocator used to allocate elements.

◆ set() [4/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename InputIt>
rpnx::set< Key, Compare, Allocator >::set ( InputIt first,
InputIt last,
Allocator const & alloc )
inline

Constructs a set from an iterator range and allocator.

Template Parameters
InputItInput iterator type.
Parameters
firstFirst element in the source range.
lastOne-past-last element in the source range.
allocAllocator used to allocate elements.

◆ set() [5/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( std::initializer_list< value_type > init,
Compare const & comp = Compare(),
Allocator const & alloc = Allocator() )
inline

Constructs a set from an initializer list.

Parameters
initValues to insert.
compComparator used to order elements.
allocAllocator used to allocate elements.

◆ set() [6/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( std::initializer_list< value_type > init,
Allocator const & alloc )
inline

Constructs a set from an initializer list and allocator.

Parameters
initValues to insert.
allocAllocator used to allocate elements.

◆ set() [7/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( set< Key, Compare, Allocator > const & other,
Allocator const & alloc )
inline

Copy-constructs a set using the specified allocator.

Parameters
otherSet to copy.
allocAllocator used to allocate elements.

◆ set() [8/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
rpnx::set< Key, Compare, Allocator >::set ( set< Key, Compare, Allocator > && other,
Allocator const & alloc )
inline

Move-constructs a set using the specified allocator.

Parameters
otherSet to move from.
allocAllocator used to allocate elements.

Member Function Documentation

◆ begin() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::begin ( ) const
inlinenoexcept

Returns an immutable iterator to the first element.

Returns
Beginning iterator.

◆ begin() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::begin ( )
inlinenoexcept

Returns an iterator to the first element.

Returns
Beginning iterator.

◆ cbegin()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::cbegin ( ) const
inlinenoexcept

Returns an immutable iterator to the first element.

Returns
Beginning iterator.

◆ cend()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::cend ( ) const
inlinenoexcept

Returns an immutable iterator one past the final element.

Returns
Ending iterator.

◆ contains()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
bool rpnx::set< Key, Compare, Allocator >::contains ( key_type const & key) const
inline

Tests whether a key is present.

Parameters
keyKey to find.
Returns
true if present.

◆ count()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
size_type rpnx::set< Key, Compare, Allocator >::count ( key_type const & key) const
inline

Counts elements matching a key.

Parameters
keyKey to find.
Returns
One when present, otherwise zero.

◆ crbegin()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_reverse_iterator rpnx::set< Key, Compare, Allocator >::crbegin ( ) const
inlinenoexcept

Returns an immutable reverse iterator to the final element.

Returns
Beginning reverse iterator.

◆ crend()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_reverse_iterator rpnx::set< Key, Compare, Allocator >::crend ( ) const
inlinenoexcept

Returns an immutable reverse iterator preceding the first element.

Returns
Ending reverse iterator.

◆ emplace()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename... Args>
std::pair< iterator, bool > rpnx::set< Key, Compare, Allocator >::emplace ( Args &&... args)
inline

Constructs a value in place if absent.

Template Parameters
ArgsValue constructor argument types.
Parameters
argsArguments forwarded to the value constructor.
Returns
Iterator to the matching element and whether insertion occurred.

◆ emplace_hint()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename... Args>
iterator rpnx::set< Key, Compare, Allocator >::emplace_hint ( const_iterator hint,
Args &&... args )
inline

Constructs a value in place using an ordering hint.

Template Parameters
ArgsValue constructor argument types.
Parameters
hintPosition immediately before which insertion may be efficient.
argsArguments forwarded to the value constructor.
Returns
Iterator to the matching element.

◆ empty()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
bool rpnx::set< Key, Compare, Allocator >::empty ( ) const
inlinenoexcept

Returns whether the set has no elements.

Returns
true when empty.

◆ end() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::end ( ) const
inlinenoexcept

Returns an immutable iterator one past the final element.

Returns
Ending iterator.

◆ end() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::end ( )
inlinenoexcept

Returns an iterator one past the final element.

Returns
Ending iterator.

◆ equal_range() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
std::pair< iterator, iterator > rpnx::set< Key, Compare, Allocator >::equal_range ( key_type const & key)
inline

Finds the range matching a key.

Parameters
keyKey to find.
Returns
Pair of lower and upper bounds.

◆ equal_range() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
std::pair< const_iterator, const_iterator > rpnx::set< Key, Compare, Allocator >::equal_range ( key_type const & key) const
inline

Finds the range matching a key.

Parameters
keyKey to find.
Returns
Pair of lower and upper bounds.

◆ erase() [1/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::erase ( const_iterator first,
const_iterator last )
inline

Erases a range.

Parameters
firstFirst element to erase.
lastOne-past-last element to erase.
Returns
Iterator following the erased range.

◆ erase() [2/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::erase ( const_iterator pos)
inline

Erases one element.

Parameters
posElement to erase.
Returns
Iterator following the erased element.

◆ erase() [3/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
size_type rpnx::set< Key, Compare, Allocator >::erase ( key_type const & key)
inline

Erases an element by key.

Parameters
keyKey to erase.
Returns
One if erased, otherwise zero.

◆ extract() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
node_type rpnx::set< Key, Compare, Allocator >::extract ( const_iterator pos)
inline

Removes an element without destroying it.

Parameters
posElement to extract.
Returns
Owning handle for the extracted node.

◆ extract() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
node_type rpnx::set< Key, Compare, Allocator >::extract ( key_type const & key)
inline

Removes an element by key without destroying it.

Parameters
keyKey to extract.
Returns
Owning handle, empty if absent.

◆ find() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::find ( key_type const & key)
inline

Finds an element by key.

Parameters
keyKey to find.
Returns
Iterator to the element, or end().

◆ find() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::find ( key_type const & key) const
inline

Finds an element by key.

Parameters
keyKey to find.
Returns
Iterator to the element, or end().

◆ get_allocator()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
allocator_type rpnx::set< Key, Compare, Allocator >::get_allocator ( ) const
inlinenoexcept

Returns the allocator used by this set.

Returns
Allocator associated with the set.

◆ insert() [1/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::insert ( const_iterator hint,
node_type && node )
inline

Inserts an extracted node using an ordering hint.

Parameters
hintPosition immediately before which insertion may be efficient.
nodeOwning node handle to insert.
Returns
Iterator to the matching element.

◆ insert() [2/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::insert ( const_iterator hint,
value_type && value )
inline

Inserts a moved value using an ordering hint.

Parameters
hintPosition immediately before which insertion may be efficient.
valueValue to move.
Returns
Iterator to the matching element.

◆ insert() [3/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::insert ( const_iterator hint,
value_type const & value )
inline

Inserts a copied value using an ordering hint.

Parameters
hintPosition immediately before which insertion may be efficient.
valueValue to copy.
Returns
Iterator to the matching element.

◆ insert() [4/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename InputIt>
void rpnx::set< Key, Compare, Allocator >::insert ( InputIt first,
InputIt last )
inline

Inserts an iterator range.

Template Parameters
InputItInput iterator type.
Parameters
firstFirst source element.
lastOne-past-last source element.

◆ insert() [5/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
insert_return_type rpnx::set< Key, Compare, Allocator >::insert ( node_type && node)
inline

Inserts an extracted node if absent.

Parameters
nodeOwning node handle to insert.
Returns
Insertion result containing the position, insertion state, and any uninserted node.

◆ insert() [6/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
void rpnx::set< Key, Compare, Allocator >::insert ( std::initializer_list< value_type > init)
inline

Inserts values from an initializer list.

Parameters
initValues to insert.

◆ insert() [7/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
std::pair< iterator, bool > rpnx::set< Key, Compare, Allocator >::insert ( value_type && value)
inline

Inserts a moved value if absent.

Parameters
valueValue to move.
Returns
Iterator to the matching element and whether insertion occurred.

◆ insert() [8/8]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
std::pair< iterator, bool > rpnx::set< Key, Compare, Allocator >::insert ( value_type const & value)
inline

Inserts a copied value if absent.

Parameters
valueValue to copy.
Returns
Iterator to the matching element and whether insertion occurred.

◆ key_comp()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
key_compare rpnx::set< Key, Compare, Allocator >::key_comp ( ) const
inline

Returns the key-ordering predicate.

Returns
Copy of the comparator.

◆ lower_bound() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::lower_bound ( key_type const & key)
inline

Finds the first element not ordered before a key.

Parameters
keyBoundary key.
Returns
Boundary iterator.

◆ lower_bound() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::lower_bound ( key_type const & key) const
inline

Finds the first element not ordered before a key.

Parameters
keyBoundary key.
Returns
Boundary iterator.

◆ max_size()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
size_type rpnx::set< Key, Compare, Allocator >::max_size ( ) const
inlinenoexcept

Returns the maximum number of elements supported by the implementation.

Returns
Maximum element count.

◆ merge() [1/4]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename C2>
void rpnx::set< Key, Compare, Allocator >::merge ( set< Key, C2, Allocator > && source)
inline

Transfers non-duplicate nodes from another RPNX set.

Template Parameters
C2Source comparator type.
Parameters
sourceSet from which nodes are transferred.

◆ merge() [2/4]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename C2>
void rpnx::set< Key, Compare, Allocator >::merge ( set< Key, C2, Allocator > & source)
inline

Transfers non-duplicate nodes from another RPNX set.

Template Parameters
C2Source comparator type.
Parameters
sourceSet from which nodes are transferred.

◆ merge() [3/4]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename C2>
void rpnx::set< Key, Compare, Allocator >::merge ( std::set< Key, C2, Allocator > && source)
inline

Transfers non-duplicate nodes from a standard set.

Template Parameters
C2Source comparator type.
Parameters
sourceSet from which nodes are transferred.

◆ merge() [4/4]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
template<typename C2>
void rpnx::set< Key, Compare, Allocator >::merge ( std::set< Key, C2, Allocator > & source)
inline

Transfers non-duplicate nodes from a standard set.

Template Parameters
C2Source comparator type.
Parameters
sourceSet from which nodes are transferred.

◆ operator=() [1/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
set & rpnx::set< Key, Compare, Allocator >::operator= ( set< Key, Compare, Allocator > && )
defaultnoexcept

Move-assigns another set.

Returns
Reference to this set.

◆ operator=() [2/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
set & rpnx::set< Key, Compare, Allocator >::operator= ( set< Key, Compare, Allocator > const & )
default

Copy-assigns another set.

Returns
Reference to this set.

◆ operator=() [3/3]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
set & rpnx::set< Key, Compare, Allocator >::operator= ( std::initializer_list< value_type > init)
inline

Replaces the contents with an initializer list.

Parameters
initValues to insert.
Returns
Reference to this set.

◆ rbegin() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_reverse_iterator rpnx::set< Key, Compare, Allocator >::rbegin ( ) const
inlinenoexcept

Returns an immutable reverse iterator to the final element.

Returns
Beginning reverse iterator.

◆ rbegin() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
reverse_iterator rpnx::set< Key, Compare, Allocator >::rbegin ( )
inlinenoexcept

Returns a reverse iterator to the final element.

Returns
Beginning reverse iterator.

◆ rend() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_reverse_iterator rpnx::set< Key, Compare, Allocator >::rend ( ) const
inlinenoexcept

Returns an immutable reverse iterator preceding the first element.

Returns
Ending reverse iterator.

◆ rend() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
reverse_iterator rpnx::set< Key, Compare, Allocator >::rend ( )
inlinenoexcept

Returns a reverse iterator preceding the first element.

Returns
Ending reverse iterator.

◆ size()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
size_type rpnx::set< Key, Compare, Allocator >::size ( ) const
inlinenoexcept

Returns the number of stored elements.

Returns
Element count.

◆ swap()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
void rpnx::set< Key, Compare, Allocator >::swap ( set< Key, Compare, Allocator > & other)
inlinenoexcept

Exchanges contents with another set.

Parameters
otherSet to exchange with.

◆ upper_bound() [1/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
iterator rpnx::set< Key, Compare, Allocator >::upper_bound ( key_type const & key)
inline

Finds the first element ordered after a key.

Parameters
keyBoundary key.
Returns
Boundary iterator.

◆ upper_bound() [2/2]

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
const_iterator rpnx::set< Key, Compare, Allocator >::upper_bound ( key_type const & key) const
inline

Finds the first element ordered after a key.

Parameters
keyBoundary key.
Returns
Boundary iterator.

◆ value_comp()

template<typename Key, typename Compare = std::less< Key >, typename Allocator = std::allocator< Key >>
value_compare rpnx::set< Key, Compare, Allocator >::value_comp ( ) const
inline

Returns the stored-value ordering predicate.

Returns
Copy of the value comparator.

The documentation for this class was generated from the following file: