StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Set< K, Compare > Class Template Referencefinal

Ordered unique values stored on Base's heap. More...

#include <StormByte/safe/set.hxx>

Classes

class  iterator
 Bidirectional cursor. More...
class  const_iterator
 Read-only bidirectional cursor. More...
class  node_type
 Owning handle to one extracted Base node. More...
struct  insert_return_type
 Result of inserting an extracted node. More...

Public Types

using key_type = K
 Value and lookup type.
using value_type = K
 Stored value.
using key_compare = Compare
 Ordering.
using value_compare = Compare
 Ordering of values. Same as the key ordering.
using size_type = Size
 Element count. Size, not std::size_t.
using difference_type = std::ptrdiff_t
 Iterator distance type.
using reference = const K&
 Read-only value reference.
using const_reference = const K&
 Read-only value reference.
using reverse_iterator = std::reverse_iterator<iterator>
 Mutable reverse iterator.
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 Read-only reverse iterator.
using insert_result = Pair<iterator, bool>
 Iterator to the value and whether it was inserted.

Public Member Functions

 Set ()
 Construct an empty set.
 Set (const Compare &compare)
 Construct an empty set with a comparator.
 Set (const Set &other)
 Copy the values.
 Set (Set &&other)
 Take the values.
 ~Set ()
 Destroy the values.
Set & operator= (const Set &other)
 Copy-assign the values.
Set & operator= (Set &&other) noexcept
 Move-assign the values.
Set & operator= (std::initializer_list< K > values)
 Replace the contents with an initializer list.
template<class InputIt>
 Set (InputIt first, InputIt last)
 Construct from an iterator range.
template<class InputIt>
 Set (InputIt first, InputIt last, const Compare &compare)
 Construct from an iterator range and a comparator.
 Set (std::initializer_list< K > values)
 Construct from an initializer list.
 Set (std::initializer_list< K > values, const Compare &compare)
 Construct from an initializer list and a comparator.
key_compare key_comp () const
 Return the ordering.
value_compare value_comp () const
 Return the ordering.
iterator begin () noexcept
 Return an iterator to the first value.
const_iterator begin () const noexcept
 Return an iterator to the first value.
const_iterator cbegin () const noexcept
 Return an iterator to the first value.
iterator end () noexcept
 Return the past-the-end iterator.
const_iterator end () const noexcept
 Return the past-the-end iterator.
const_iterator cend () const noexcept
 Return the past-the-end iterator.
reverse_iterator rbegin () noexcept
 Return a reverse iterator to the last value.
const_reverse_iterator rbegin () const noexcept
 Return a reverse iterator to the last value.
const_reverse_iterator crbegin () const noexcept
 Return a reverse iterator to the last value.
reverse_iterator rend () noexcept
 Return the past-the-start reverse iterator.
const_reverse_iterator rend () const noexcept
 Return the past-the-start reverse iterator.
const_reverse_iterator crend () const noexcept
 Return the past-the-start reverse iterator.
bool empty () const noexcept
 Test whether the set has no values.
size_type size () const noexcept
 Return the number of values.
size_type max_size () const noexcept
 Return the maximum number of values.
void clear () noexcept
 Destroy every value.
insert_result insert (const K &value)
 Insert a value if it is absent.
insert_result insert (K &&value)
 Insert a value if it is absent.
iterator insert (const_iterator hint, const K &value)
 Insert a value, using hint when the neighbours confirm it.
iterator insert (const_iterator hint, K &&value)
 Insert a value, using hint when the neighbours confirm it.
template<class InputIt>
void insert (InputIt first, InputIt last)
 Insert every value in [first, last).
void insert (std::initializer_list< K > values)
 Insert every value of an initializer list.
template<std::ranges::input_range R>
requires std::convertible_to<std::ranges::range_reference_t<R>, value_type>
STORMBYTE_FORCE_INLINE void insert_range (R &&range)
 Insert a copy of range.
template<class... Args>
insert_result emplace (Args &&... args)
 Construct a value in a new node if it is absent.
template<class... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
 Construct a value, using hint when the neighbours confirm it.
insert_return_type insert (node_type &&handle)
 Insert an extracted node if its value is absent.
iterator insert (const_iterator hint, node_type &&handle)
 Insert an extracted node, using hint when the neighbours confirm it.
node_type extract (const_iterator position)
 Unlink the value at position and return that node.
node_type extract (const K &value)
 Unlink value and return that node.
template<class OtherCompare>
void merge (Set< K, OtherCompare > &source)
 Take unique values from source.
iterator erase (iterator position) noexcept
 Erase the value at an iterator.
iterator erase (const_iterator position) noexcept
 Erase the value at a read-only iterator.
iterator erase (const_iterator first, const_iterator last) noexcept
 Erase [first, last).
size_type erase (const K &value) noexcept
 Erase a value.
void swap (Set &other) noexcept
 Exchange values and comparators.
iterator find (const K &value)
 Find a value.
const_iterator find (const K &value) const
 Find a value.
size_type count (const K &value) const
 Count matching values.
bool contains (const K &value) const
 Test whether a value is present.
iterator lower_bound (const K &value)
 Return the first value not less than value.
const_iterator lower_bound (const K &value) const
 Return the first value not less than value.
iterator upper_bound (const K &value)
 Return the first value greater than value.
const_iterator upper_bound (const K &value) const
 Return the first value greater than value.
Pair< iterator, iterator > equal_range (const K &value)
 Return the range of values equal to value.
Pair< const_iterator, const_iterator > equal_range (const K &value) const
 Return the range of values equal to value.
bool operator== (const Set &other) const
 Compare lexicographically.
bool operator!= (const Set &other) const
 Compare lexicographically.
bool operator< (const Set &other) const
 Compare lexicographically.
bool operator<= (const Set &other) const
 Compare lexicographically.
bool operator> (const Set &other) const
 Compare lexicographically.
bool operator>= (const Set &other) const
 Compare lexicographically.
STORMBYTE_FORCE_INLINE operator std::set< K, Compare > () const
 Copy the values into caller-owned STL storage.

Detailed Description

template<Type::SafeValue K, class Compare = std::less<K>>
requires std::strict_weak_order<Compare, const K&, const K&>
class StormByte::Safe::Set< K, Compare >

Ordered unique values stored on Base's heap.

Template Parameters
KSafe value type.
CompareStrict weak ordering. A stateless comparator does not allocate. A stateful one is stored in the set and must itself be Safe.

The tree is the same Base-heap tree as Map. Iterators yield the key, not a pair. node_type owns a Base node. It is not std::set::node_type. There is no allocator.

Member Typedef Documentation

◆ const_reference

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_reference = const K&

Read-only value reference.

◆ const_reverse_iterator

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Read-only reverse iterator.

◆ difference_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::difference_type = std::ptrdiff_t

Iterator distance type.

◆ insert_result

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::insert_result = Pair<iterator, bool>

Iterator to the value and whether it was inserted.

◆ key_compare

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::key_compare = Compare

Ordering.

◆ key_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::key_type = K

Value and lookup type.

◆ reference

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::reference = const K&

Read-only value reference.

◆ reverse_iterator

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::reverse_iterator = std::reverse_iterator<iterator>

Mutable reverse iterator.

◆ size_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::size_type = Size

Element count. Size, not std::size_t.

◆ value_compare

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::value_compare = Compare

Ordering of values. Same as the key ordering.

◆ value_type

template<Type::SafeValue K, class Compare = std::less<K>>
using StormByte::Safe::Set< K, Compare >::value_type = K

Stored value.

Constructor & Destructor Documentation

◆ Set() [1/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( )

Construct an empty set.

◆ Set() [2/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( const Compare & compare)
explicit

Construct an empty set with a comparator.

Parameters
compareValue ordering.

◆ Set() [3/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( const Set< K, Compare > & other)

Copy the values.

Parameters
otherSource.
Exceptions
AllocationErrorA node could not be allocated.

◆ Set() [4/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( Set< K, Compare > && other)

Take the values.

other is left empty.

Parameters
otherSource.

◆ ~Set()

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::~Set ( )

Destroy the values.

◆ Set() [5/8]

template<Type::SafeValue K, class Compare = std::less<K>>
template<class InputIt>
StormByte::Safe::Set< K, Compare >::Set ( InputIt first,
InputIt last )

Construct from an iterator range.

Template Parameters
InputItInput iterator of values.
Parameters
firstStart.
lastEnd.
Exceptions
AllocationErrorA node could not be allocated.

◆ Set() [6/8]

template<Type::SafeValue K, class Compare = std::less<K>>
template<class InputIt>
StormByte::Safe::Set< K, Compare >::Set ( InputIt first,
InputIt last,
const Compare & compare )

Construct from an iterator range and a comparator.

Template Parameters
InputItInput iterator of values.
Parameters
firstStart.
lastEnd.
compareValue ordering.
Exceptions
AllocationErrorA node could not be allocated.

◆ Set() [7/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( std::initializer_list< K > values)

Construct from an initializer list.

Parameters
valuesValues. Duplicates are dropped.
Exceptions
AllocationErrorA node could not be allocated.

◆ Set() [8/8]

template<Type::SafeValue K, class Compare = std::less<K>>
StormByte::Safe::Set< K, Compare >::Set ( std::initializer_list< K > values,
const Compare & compare )

Construct from an initializer list and a comparator.

Parameters
valuesValues. Duplicates are dropped.
compareValue ordering.
Exceptions
AllocationErrorA node could not be allocated.

Member Function Documentation

◆ begin() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::begin ( ) const
noexcept

Return an iterator to the first value.

Returns
First value, or end when empty.

◆ begin() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::begin ( )
noexcept

Return an iterator to the first value.

Returns
First value, or end when empty.

◆ cbegin()

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::cbegin ( ) const
noexcept

Return an iterator to the first value.

Returns
First value, or end when empty.

◆ cend()

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::cend ( ) const
noexcept

Return the past-the-end iterator.

Returns
End iterator.

◆ clear()

template<Type::SafeValue K, class Compare = std::less<K>>
void StormByte::Safe::Set< K, Compare >::clear ( )
noexcept

Destroy every value.

◆ contains()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::contains ( const K & value) const

Test whether a value is present.

Parameters
valueLookup value.
Returns
Whether the value is present.

◆ count()

template<Type::SafeValue K, class Compare = std::less<K>>
size_type StormByte::Safe::Set< K, Compare >::count ( const K & value) const

Count matching values.

Parameters
valueLookup value.
Returns
Zero or one.

◆ crbegin()

template<Type::SafeValue K, class Compare = std::less<K>>
const_reverse_iterator StormByte::Safe::Set< K, Compare >::crbegin ( ) const
noexcept

Return a reverse iterator to the last value.

Returns
Last value, or rend when empty.

◆ crend()

template<Type::SafeValue K, class Compare = std::less<K>>
const_reverse_iterator StormByte::Safe::Set< K, Compare >::crend ( ) const
noexcept

Return the past-the-start reverse iterator.

Returns
Reverse end.

◆ emplace()

template<Type::SafeValue K, class Compare = std::less<K>>
template<class... Args>
insert_result StormByte::Safe::Set< K, Compare >::emplace ( Args &&... args)

Construct a value in a new node if it is absent.

Template Parameters
ArgsValue constructor argument types.
Parameters
argsArguments forwarded to K.
Returns
Iterator to the value and whether it was inserted.
Exceptions
AllocationErrorThe node could not be allocated.

◆ emplace_hint()

template<Type::SafeValue K, class Compare = std::less<K>>
template<class... Args>
iterator StormByte::Safe::Set< K, Compare >::emplace_hint ( const_iterator hint,
Args &&... args )

Construct a value, using hint when the neighbours confirm it.

Template Parameters
ArgsValue constructor argument types.
Parameters
hintSuggested position.
argsArguments forwarded to K.
Returns
Iterator to the value.
Exceptions
AllocationErrorThe node could not be allocated.

◆ empty()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::empty ( ) const
noexcept

Test whether the set has no values.

Returns
Whether the set is empty.

◆ end() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::end ( ) const
noexcept

Return the past-the-end iterator.

Returns
End iterator.

◆ end() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::end ( )
noexcept

Return the past-the-end iterator.

Returns
End iterator.

◆ equal_range() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
Pair< iterator, iterator > StormByte::Safe::Set< K, Compare >::equal_range ( const K & value)

Return the range of values equal to value.

Parameters
valueLookup value.
Returns
Lower and upper bound.

◆ equal_range() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
Pair< const_iterator, const_iterator > StormByte::Safe::Set< K, Compare >::equal_range ( const K & value) const

Return the range of values equal to value.

Parameters
valueLookup value.
Returns
Lower and upper bound.

◆ erase() [1/4]

template<Type::SafeValue K, class Compare = std::less<K>>
size_type StormByte::Safe::Set< K, Compare >::erase ( const K & value)
noexcept

Erase a value.

Parameters
valueLookup value.
Returns
Number of erased values, zero or one.

◆ erase() [2/4]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::erase ( const_iterator first,
const_iterator last )
noexcept

Erase [first, last).

Parameters
firstFirst value to erase.
lastEnd of the range.
Returns
Iterator following the last erased value.

◆ erase() [3/4]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::erase ( const_iterator position)
noexcept

Erase the value at a read-only iterator.

Parameters
positionValue to erase.
Returns
Iterator following the erased value.

◆ erase() [4/4]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::erase ( iterator position)
noexcept

Erase the value at an iterator.

Parameters
positionValue to erase.
Returns
Iterator following the erased value.

◆ extract() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
node_type StormByte::Safe::Set< K, Compare >::extract ( const K & value)

Unlink value and return that node.

Parameters
valueLookup value.
Returns
Owning handle. Empty when the value is absent.

◆ extract() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
node_type StormByte::Safe::Set< K, Compare >::extract ( const_iterator position)

Unlink the value at position and return that node.

Parameters
positionValue to extract.
Returns
Owning handle. Empty when position is end.

◆ find() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::find ( const K & value)

Find a value.

Parameters
valueLookup value.
Returns
Iterator to the value, or end.

◆ find() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::find ( const K & value) const

Find a value.

Parameters
valueLookup value.
Returns
Iterator to the value, or end.

◆ insert() [1/8]

template<Type::SafeValue K, class Compare = std::less<K>>
insert_result StormByte::Safe::Set< K, Compare >::insert ( const K & value)

Insert a value if it is absent.

Parameters
valueValue to copy.
Returns
Iterator to the value and whether it was inserted.
Exceptions
AllocationErrorThe node could not be allocated.

◆ insert() [2/8]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::insert ( const_iterator hint,
const K & value )

Insert a value, using hint when the neighbours confirm it.

Parameters
hintSuggested position.
valueValue to copy.
Returns
Iterator to the value.
Exceptions
AllocationErrorThe node could not be allocated.

◆ insert() [3/8]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::insert ( const_iterator hint,
K && value )

Insert a value, using hint when the neighbours confirm it.

Parameters
hintSuggested position.
valueValue to move.
Returns
Iterator to the value.
Exceptions
AllocationErrorThe node could not be allocated.

◆ insert() [4/8]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::insert ( const_iterator hint,
node_type && handle )

Insert an extracted node, using hint when the neighbours confirm it.

Parameters
hintSuggested position.
handleNode from a set with this ordering. Emptied when inserted.
Returns
Iterator to the value, or end when handle was empty.

◆ insert() [5/8]

template<Type::SafeValue K, class Compare = std::less<K>>
template<class InputIt>
void StormByte::Safe::Set< K, Compare >::insert ( InputIt first,
InputIt last )

Insert every value in [first, last).

Template Parameters
InputItInput iterator of values.
Parameters
firstStart.
lastEnd.
Exceptions
AllocationErrorA node could not be allocated.

◆ insert() [6/8]

template<Type::SafeValue K, class Compare = std::less<K>>
insert_result StormByte::Safe::Set< K, Compare >::insert ( K && value)

Insert a value if it is absent.

Parameters
valueValue to move.
Returns
Iterator to the value and whether it was inserted.
Exceptions
AllocationErrorThe node could not be allocated.

◆ insert() [7/8]

template<Type::SafeValue K, class Compare = std::less<K>>
insert_return_type StormByte::Safe::Set< K, Compare >::insert ( node_type && handle)

Insert an extracted node if its value is absent.

The same node is linked.

Parameters
handleNode from a set with this ordering. Emptied when inserted.
Returns
Position, whether it was inserted, and the rejected node.

◆ insert() [8/8]

template<Type::SafeValue K, class Compare = std::less<K>>
void StormByte::Safe::Set< K, Compare >::insert ( std::initializer_list< K > values)

Insert every value of an initializer list.

Parameters
valuesValues.
Exceptions
AllocationErrorA node could not be allocated.

◆ insert_range()

template<Type::SafeValue K, class Compare = std::less<K>>
template<std::ranges::input_range R>
requires std::convertible_to<std::ranges::range_reference_t<R>, value_type>
STORMBYTE_FORCE_INLINE void StormByte::Safe::Set< K, Compare >::insert_range ( R && range)
inline

Insert a copy of range.

Template Parameters
RInput range of values.
Parameters
rangeSource. Instantiated in the caller.
Exceptions
AllocationErrorA node could not be allocated.

◆ key_comp()

template<Type::SafeValue K, class Compare = std::less<K>>
key_compare StormByte::Safe::Set< K, Compare >::key_comp ( ) const

Return the ordering.

Returns
Comparator.

◆ lower_bound() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::lower_bound ( const K & value)

Return the first value not less than value.

Parameters
valueLookup value.
Returns
Lower bound, or end.

◆ lower_bound() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::lower_bound ( const K & value) const

Return the first value not less than value.

Parameters
valueLookup value.
Returns
Lower bound, or end.

◆ max_size()

template<Type::SafeValue K, class Compare = std::less<K>>
size_type StormByte::Safe::Set< K, Compare >::max_size ( ) const
noexcept

Return the maximum number of values.

Returns
Implementation limit.

◆ merge()

template<Type::SafeValue K, class Compare = std::less<K>>
template<class OtherCompare>
void StormByte::Safe::Set< K, Compare >::merge ( Set< K, OtherCompare > & source)

Take unique values from source.

Template Parameters
OtherCompareSource ordering.
Parameters
sourceSet to drain. The same ordering transfers the node. A different ordering copies the key. Values already present stay in source.
Exceptions
AllocationErrorA copied node could not be allocated.

◆ operator std::set< K, Compare >()

template<Type::SafeValue K, class Compare = std::less<K>>
STORMBYTE_FORCE_INLINE StormByte::Safe::Set< K, Compare >::operator std::set< K, Compare > ( ) const
inlineexplicit

Copy the values into caller-owned STL storage.

Returns
A std::set owned by the caller.

◆ operator!=()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator!= ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether the sets differ.

◆ operator<()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator< ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether this set precedes other.

◆ operator<=()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator<= ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether this set precedes or equals other.

◆ operator=() [1/3]

template<Type::SafeValue K, class Compare = std::less<K>>
Set & StormByte::Safe::Set< K, Compare >::operator= ( const Set< K, Compare > & other)

Copy-assign the values.

Parameters
otherSource.
Returns
This set.
Exceptions
AllocationErrorA node could not be allocated.

◆ operator=() [2/3]

template<Type::SafeValue K, class Compare = std::less<K>>
Set & StormByte::Safe::Set< K, Compare >::operator= ( Set< K, Compare > && other)
noexcept

Move-assign the values.

other is left empty.

Parameters
otherSource.
Returns
This set.

◆ operator=() [3/3]

template<Type::SafeValue K, class Compare = std::less<K>>
Set & StormByte::Safe::Set< K, Compare >::operator= ( std::initializer_list< K > values)

Replace the contents with an initializer list.

Parameters
valuesValues. Duplicates are dropped.
Returns
This set.
Exceptions
AllocationErrorA node could not be allocated.

◆ operator==()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator== ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether this set is equal to other.

◆ operator>()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator> ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether this set follows other.

◆ operator>=()

template<Type::SafeValue K, class Compare = std::less<K>>
bool StormByte::Safe::Set< K, Compare >::operator>= ( const Set< K, Compare > & other) const

Compare lexicographically.

Parameters
otherOther set.
Returns
Whether this set follows or equals other.

◆ rbegin() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_reverse_iterator StormByte::Safe::Set< K, Compare >::rbegin ( ) const
noexcept

Return a reverse iterator to the last value.

Returns
Last value, or rend when empty.

◆ rbegin() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
reverse_iterator StormByte::Safe::Set< K, Compare >::rbegin ( )
noexcept

Return a reverse iterator to the last value.

Returns
Last value, or rend when empty.

◆ rend() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_reverse_iterator StormByte::Safe::Set< K, Compare >::rend ( ) const
noexcept

Return the past-the-start reverse iterator.

Returns
Reverse end.

◆ rend() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
reverse_iterator StormByte::Safe::Set< K, Compare >::rend ( )
noexcept

Return the past-the-start reverse iterator.

Returns
Reverse end.

◆ size()

template<Type::SafeValue K, class Compare = std::less<K>>
size_type StormByte::Safe::Set< K, Compare >::size ( ) const
noexcept

Return the number of values.

Returns
Value count.

◆ swap()

template<Type::SafeValue K, class Compare = std::less<K>>
void StormByte::Safe::Set< K, Compare >::swap ( Set< K, Compare > & other)
noexcept

Exchange values and comparators.

Parameters
otherOther set.

◆ upper_bound() [1/2]

template<Type::SafeValue K, class Compare = std::less<K>>
iterator StormByte::Safe::Set< K, Compare >::upper_bound ( const K & value)

Return the first value greater than value.

Parameters
valueLookup value.
Returns
Upper bound, or end.

◆ upper_bound() [2/2]

template<Type::SafeValue K, class Compare = std::less<K>>
const_iterator StormByte::Safe::Set< K, Compare >::upper_bound ( const K & value) const

Return the first value greater than value.

Parameters
valueLookup value.
Returns
Upper bound, or end.

◆ value_comp()

template<Type::SafeValue K, class Compare = std::less<K>>
value_compare StormByte::Safe::Set< K, Compare >::value_comp ( ) const

Return the ordering.

Returns
Comparator.

The documentation for this class was generated from the following file:
  • lib/public/StormByte/safe/set.hxx