Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::inline_set< Value, Capacity, Compare > Class Template Reference

A non-allocating fixed-capacity associative container storing elements of type Value . More...

Inheritance diagram for arene::base::inline_set< Value, Capacity, Compare >:
Inheritance graph

Public Types

using const_iterator = iterator
 A const iterator for the set: the same as iterator, since elements are const.
 
using const_pointer = value_type const*
 A pointer to a const value.
 
using const_reference = value_type const&
 A reference to a const value.
 
using const_reverse_iterator = ::arene::base::reverse_iterator<const_iterator>
 A const reverse iterator for the set.
 
using difference_type = std::ptrdiff_t
 The type of the difference between two iterators.
 
using iterator = iterator_impl
 The iterator type for the set.
 
using key_compare = Compare
 The type of the comparator for the key.
 
using key_type = Value
 The type of the key in the set, which is the same as the value.
 
using pointer = value_type*
 A pointer to the value.
 
using reference = value_type&
 A reference to a value.
 
using reverse_iterator = ::arene::base::reverse_iterator<iterator>
 A reverse iterator for the set.
 
using size_type = std::size_t
 The type of the size of the container.
 
using value_compare = Compare
 The type of the comparator for the value.
 
using value_type = Value
 The type of the value in the set.
 

Public Member Functions

 inline_set ()=default
 Construct a set with no elements and a default-constructed comparator.
 
 inline_set (Compare const &comp) noexcept(std::is_nothrow_copy_constructible< Compare >::value)
 Construct a set with no elements, using the specified comparator.
 
 inline_set (inline_set const &)=default
 copy ctor.
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_move_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
 inline_set (inline_set< Value, OtherCapacity, Compare > &&other)
 move construct from a set with a larger capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_move_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
 inline_set (inline_set< Value, OtherCapacity, Compare > &&other) noexcept(std::is_nothrow_move_constructible< Value >::value &&std::is_nothrow_move_constructible< Compare >::value)
 move construct from a set with a smaller capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
 inline_set (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_copy_constructible< Compare >::value)
 copy construct from a set with a smaller capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
 inline_set (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_copy_constructible< Compare >::value)
 copy construct from a set with a larger capacity
 
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
 inline_set (Iterator first, Iterator last) noexcept(std::is_nothrow_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value &&std::is_nothrow_constructible< Compare >::value)
 Construct a set from the elements in the provided iterator range.
 
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
 inline_set (Iterator first, Iterator last, Compare const &comp) noexcept(std::is_nothrow_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value &&std::is_nothrow_copy_constructible< Compare >::value)
 Construct a set from the elements in the provided iterator range and comparator.
 
 inline_set (move_construct_source &&other) noexcept(std::is_nothrow_move_constructible< Value >::value &&std::is_nothrow_constructible< Compare >::value)
 move ctor
 
 inline_set (std::initializer_list< Value > init) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_constructible< Compare >::value)
 Construct a set from the specified list of values.
 
 inline_set (std::initializer_list< Value > init, Compare const &comp) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_copy_constructible< Compare >::value)
 Construct a set from the specified list of values and a specified comparator instance .
 
 ~inline_set ()=default
 Default destructor; destroys all stored elements.
 
auto begin () const noexcept -> const_iterator
 Obtain an iterator referring to the beginning of the sorted range of elements.
 
auto cbegin () const noexcept -> const_iterator
 Obtain an iterator referring to the beginning of the sorted range of elements.
 
auto cend () const noexcept -> const_iterator
 Obtain an iterator referring to one past the last element in the sorted range of elements.
 
void clear () noexcept
 Erase all the elements in *this.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto contains (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> bool
 Check if the set contains a value equivalent to a specific value.
 
auto contains (Value const &value_to_check) const noexcept(comparison_is_noexcept<>) -> bool
 Check if the set contains a specific value.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto count (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> std::size_t
 Return the number of elements in the set equivalent to a specific value.
 
auto count (Value const &value_to_count) const noexcept(comparison_is_noexcept<>) -> std::size_t
 Return the number of elements in the set equivalent to a specific value.
 
auto crbegin () const noexcept -> const_reverse_iterator
 Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.
 
auto crend () const noexcept -> const_reverse_iterator
 Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.
 
template<typename... ArgTypes, constraints< std::enable_if_t< std::is_constructible< Value, ArgTypes &&... >::value > > = nullptr>
auto emplace (ArgTypes &&... args) -> std::pair< iterator, bool >
 Construct a new element from the specified initialization arguments, and then attempt to insert it.
 
ARENE_NODISCARD auto empty () const noexcept -> bool
 Check if the set is empty.
 
auto end () const noexcept -> const_iterator
 Obtain an iterator referring to one past the last element in the sorted range of elements.
 
auto entry_at_index (inline_set_detail::set_passkey, index_type index) const noexcept -> entry_type const &
 Gets a reference to the element corrsponding to a given index.
 
auto entry_at_index (inline_set_detail::set_passkey, index_type index) noexcept -> entry_type &
 Gets a reference to the element corrsponding to a given index.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto equal_range (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> std::pair< const_iterator, const_iterator >
 Finds the sequence of values which compare equivalent to a given value.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto equal_range (OtherKey const &value) noexcept(comparison_is_noexcept< OtherKey >) -> std::pair< iterator, iterator >
 Finds the sequence of values which compare equivalent to a given value.
 
auto equal_range (Value const &value_to_find) const noexcept(comparison_is_noexcept<>) -> std::pair< const_iterator, const_iterator >
 Finds the sequence of values which compare equivalent to a given value.
 
auto equal_range (Value const &value_to_find) noexcept(comparison_is_noexcept<>) -> std::pair< iterator, iterator >
 Finds the sequence of values which compare equivalent to a given value.
 
auto erase (iterator first, iterator last) noexcept -> iterator
 Erase all the elements referred to be the specified iterator range.
 
auto erase (iterator pos) noexcept -> iterator
 Erase the element referred to be the specified iterator.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto erase (OtherKey const &value) noexcept(comparison_is_noexcept< OtherKey >) -> size_type
 Erase any elements with a value equivalent to the supplied element.
 
auto erase (Value const &value_to_erase) noexcept(comparison_is_noexcept<>) -> size_type
 Erase any elements with a value equivalent to the supplied element.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto find (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator
 Obtain an iterator referring to the element equivalent to the supplied value, if there is one.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto find (OtherKey const &value) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
 Obtain an iterator referring to the element equivalent to the supplied value, if there is one.
 
auto find (Value const &value_to_find) const noexcept(comparison_is_noexcept<>) -> const_iterator
 Obtain an iterator referring to the element equivalent to the supplied value, if there is one.
 
auto find (Value const &value_to_find) noexcept(comparison_is_noexcept<>) -> iterator
 Obtain an iterator referring to the element equivalent to the supplied value, if there is one.
 
auto get_comparator_base (inline_set_detail::set_passkey) const noexcept -> comparator_base const &
 Get the comparator base.
 
auto get_comparator_base (inline_set_detail::set_passkey) noexcept -> comparator_base &
 Get the comparator base.
 
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
void insert (Iterator first, Iterator last) noexcept(std::is_nothrow_constructible< Value, >::value)
 Insert all the elements in the provided iterator range into the set, if there are not already equivalent elements.
 
template<typename OtherKey, typename SfinaeKey = Value, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > >, std::enable_if_t<!std::is_integral< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, OtherKey && >::value > > = nullptr>
auto insert (OtherKey &&value) noexcept(comparison_is_noexcept< OtherKey > &&std::is_nothrow_constructible< Value, OtherKey && >::value) -> std::pair< iterator, bool >
 Attempt to insert an element into the set.
 
void insert (std::initializer_list< Value > init)
 Attempt to insert the elements in the provided initializer list into the set.
 
auto insert (Value &&value_to_insert) noexcept(comparison_is_noexcept<> &&std::is_nothrow_move_constructible< Value >::value) -> std::pair< iterator, bool >
 Attempt to insert an element into the set.
 
auto insert (Value const &value_to_insert) noexcept(comparison_is_noexcept<> &&std::is_nothrow_copy_constructible< Value >::value) -> std::pair< iterator, bool >
 Attempt to insert an element into the set.
 
auto key_comp () const noexcept(std::is_nothrow_copy_constructible< Compare >::value) -> key_compare
 Get the comparator.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto lower_bound (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator
 Find the first element which is not less than a given value.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto lower_bound (OtherKey const &value) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
 Find the first element which is not less than a given value.
 
auto lower_bound (Value const &value_to_find) const noexcept(comparison_is_noexcept<>) -> const_iterator
 Find the first element which is not less than a given value.
 
auto lower_bound (Value const &value_to_find) noexcept(comparison_is_noexcept<>) -> iterator
 Find the first element which is not less than a given value.
 
auto operator= (copy_assign_source const &other) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_copy_assignable< Compare >::value) -> inline_set &
 copy-assignment operator.
 
auto operator= (deleted_copy_assign_source const &other) -> inline_set &=delete
 Deleted copy-assignment operator where the set is not copy-assignable.
 
auto operator= (deleted_move_assign_source &&) -> inline_set &=delete
 The move assignment operator is deleted if move assignment is not supported.
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_move_assignable< inline_set< Value, OtherCapacity, Compare > >::value >>
auto operator= (inline_set< Value, OtherCapacity, Compare > &&other) -> inline_set &
 move-assignment operator from an inline_set with a larger capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_move_assignable< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
auto operator= (inline_set< Value, OtherCapacity, Compare > &&other) noexcept(std::is_nothrow_move_assignable< inline_set< Value, OtherCapacity, Compare > >::value) -> inline_set &
 move-assignment operator from an inline_set with a smaller capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_assignable< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
auto operator= (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(std::is_nothrow_copy_assignable< inline_set< Value, OtherCapacity, Compare > >::value) -> inline_set &
 copy-assignment operator for copying from a set with a smaller capacity
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_assignable< inline_set< Value, OtherCapacity, Compare > >::value >>
auto operator= (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(std::is_nothrow_copy_constructible< Value >::value &&std::is_nothrow_copy_assignable< Compare >::value) -> inline_set &
 copy-assignment operator for copying from a set with a larger capacity
 
auto operator= (move_assign_source &&other) noexcept(std::is_nothrow_move_constructible< Value >::value &&std::is_nothrow_move_assignable< Compare >::value) -> inline_set &
 move-assignment operator
 
auto rbegin () const noexcept -> const_reverse_iterator
 Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.
 
auto rend () const noexcept -> const_reverse_iterator
 Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.
 
auto size () const noexcept -> std::size_t
 Get the number of elements in the set.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto upper_bound (OtherKey const &value) const noexcept(comparison_is_noexcept< OtherKey >) -> const_iterator
 Find the first element which is greater than a given value.
 
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto upper_bound (OtherKey const &value) noexcept(comparison_is_noexcept< OtherKey >) -> iterator
 Find the first element which is greater than a given value.
 
auto upper_bound (Value const &value_to_find) const noexcept(comparison_is_noexcept<>) -> const_iterator
 Find the first element which is greater than a given value.
 
auto upper_bound (Value const &value_to_find) noexcept(comparison_is_noexcept<>) -> iterator
 Find the first element which is greater than a given value.
 
auto value_comp () const noexcept(std::is_nothrow_copy_constructible< Compare >::value) -> value_compare
 Get the comparator.
 

Static Public Member Functions

template<size_type OtherCapacity>
static ARENE_NODISCARD auto fast_inequality_check (inline_set const &lhs, inline_set< Value, OtherCapacity, Compare > const &rhs) noexcept -> inequality_heuristic
 Fast inequality heuristic to shortcut on different sized containers.
 
template<size_type OtherCapacity, typename SfinaeKey = key_type, constraints< std::enable_if_t< compare_three_way_supported_v< SfinaeKey > > > = nullptr>
static ARENE_NODISCARD auto three_way_compare (inline_set const &lhs, inline_set< Value, OtherCapacity, Compare > const &rhs) noexcept -> strong_ordering
 Compares two sets lexicographically .
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
static ARENE_NODISCARD auto try_construct (inline_set< Value, OtherCapacity, Compare > &&other) noexcept(noexcept(inline_set{other})) -> optional< inline_set >
 Attempts to construct a set via move-construction from a set with a larger capacity.
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity<=Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
static ARENE_NODISCARD auto try_construct (inline_set< Value, OtherCapacity, Compare > &&other) noexcept(noexcept(inline_set{std::move(other)})) -> optional< inline_set >
 Attempts to construct a set via move-construction from a set with a capacity that is less than or equal to the target capacity.
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity<=Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
static ARENE_NODISCARD auto try_construct (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(noexcept(inline_set{other})) -> optional< inline_set >
 Attempts to construct a set via copy-construction from a set with the same or smaller capacity.
 
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
static ARENE_NODISCARD auto try_construct (inline_set< Value, OtherCapacity, Compare > const &other) noexcept(noexcept(inline_set{other})) -> optional< inline_set >
 Attempts to construct a set from a set with a larger capacity.
 
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
static ARENE_NODISCARD auto try_construct (Iterator first, Iterator last) noexcept(noexcept(inline_set{first, last}) &&std::is_nothrow_move_constructible< inline_set >::value) -> optional< inline_set >
 Attempt to construct a set from the specified sequence of values.
 
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
static ARENE_NODISCARD auto try_construct (Iterator first, Iterator last, Compare const &comp) noexcept(noexcept(inline_set{first, last, comp}) &&std::is_nothrow_move_constructible< inline_set >::value) -> optional< inline_set >
 Attempt to construct a set from the specified sequence of values and a comparator.
 
static ARENE_NODISCARD auto try_construct (std::initializer_list< Value > init) noexcept(noexcept(inline_set{init}) &&std::is_nothrow_move_constructible< inline_set >::value) -> optional< inline_set >
 Attempt to construct a set from the specified list of values.
 
static ARENE_NODISCARD auto try_construct (std::initializer_list< Value > init, Compare const &comp) noexcept(noexcept(inline_set{init, comp}) &&std::is_nothrow_move_constructible< inline_set >::value) -> optional< inline_set >
 Attempt to construct a set from the specified list of values and a comparator.
 

Static Public Attributes

static constexpr std::integral_constant< size_type, Capacity > capacity {}
 The maximum number of elements that can be held in the set.
 
static constexpr std::integral_constant< size_type, Capacity > max_size {}
 Get the maximum number of elements in the set.
 

Detailed Description

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
class arene::base::inline_set< Value, Capacity, Compare >

A non-allocating fixed-capacity associative container storing elements of type Value .

Any attempt to store more than Capacity elements will result in an ARENE_PRECONDITION violation. The comparison function specified with the Compare template parameter can either return bool, in which case it is assumed to be a simple ordering comparison like std::less, or it can return strong_ordering, in which case it is assumed to be a three-way comparison operator. The default comparison is three_way_compare.

Template Parameters
ValueThe type of values stored in the set. Must satisfy std::is_nothrow_destructible .
CapacityThe maximum number of elements that can be stored in the set .
CompareThe comparison function used to impose a sort order on the elements. Must satisfy std::is_nothrow_destructible as well as either is_invocable_r_v<bool, const Compare&, const Value&, const Value&> or is_invocable_r_v<strong_ordering, const Compare&, const Value&, const Value&>. The comparison must provide a strict ordering over the values of Value , and copies or moves of the comparator must yield the same ordering. Defaults to compare_three_way .

Member Typedef Documentation

◆ const_iterator

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::const_iterator = iterator

A const iterator for the set: the same as iterator, since elements are const.

◆ const_pointer

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::const_pointer = value_type const*

A pointer to a const value.

◆ const_reference

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::const_reference = value_type const&

A reference to a const value.

◆ const_reverse_iterator

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::const_reverse_iterator = ::arene::base::reverse_iterator<const_iterator>

A const reverse iterator for the set.

◆ difference_type

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::difference_type = std::ptrdiff_t

The type of the difference between two iterators.

◆ iterator

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::iterator = iterator_impl

The iterator type for the set.

◆ key_compare

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::key_compare = Compare

The type of the comparator for the key.

◆ key_type

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::key_type = Value

The type of the key in the set, which is the same as the value.

◆ pointer

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::pointer = value_type*

A pointer to the value.

◆ reference

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::reference = value_type&

A reference to a value.

◆ reverse_iterator

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::reverse_iterator = ::arene::base::reverse_iterator<iterator>

A reverse iterator for the set.

◆ size_type

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::size_type = std::size_t

The type of the size of the container.

◆ value_compare

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::value_compare = Compare

The type of the comparator for the value.

◆ value_type

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
using arene::base::inline_set< Value, Capacity, Compare >::value_type = Value

The type of the value in the set.

Constructor & Destructor Documentation

◆ inline_set() [1/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( )
default

Construct a set with no elements and a default-constructed comparator.

◆ ~inline_set()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::~inline_set ( )
default

Default destructor; destroys all stored elements.

◆ inline_set() [2/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( Compare const & comp)
inlineexplicitnoexcept

Construct a set with no elements, using the specified comparator.

Parameters
compThe comparator to use
Postcondition
size()==0

◆ inline_set() [3/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( std::initializer_list< Value > init)
inlinenoexcept

Construct a set from the specified list of values.

Parameters
initThe list of elements to store in the set
Postcondition
size()==init.size()
The elements in the set will be the unique elements of init , sorted via a default-constructed instance of Compare .
Precondition
init.size()<=max_size() else ARENE_PRECONDITION violation .

◆ inline_set() [4/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( std::initializer_list< Value > init,
Compare const & comp )
inlinenoexcept

Construct a set from the specified list of values and a specified comparator instance .

Parameters
initThe list of elements to store in the set .
compThe comparator to use.
Postcondition
size()==init.size()
The elements in the set will be the unique elements of init , sorted via comp .
Precondition
init.size()<=max_size() else ARENE_PRECONDITION violation .

◆ inline_set() [5/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( Iterator first,
Iterator last )
inlinenoexcept

Construct a set from the elements in the provided iterator range.

Template Parameters
IteratorThe type of the iterators. Must satisfy std::is_constructible<Value,std::iterator_traits<Iterator>::reference> .
Parameters
firstThe iterator to the first element in the range
lastThe iterator to the one-past-the-end element in the range
Postcondition
size() will be equal to the number of unique elements in the range [first,last)
The elements in the set will be the unique elements in the range [first,last) , sorted via a default-constructed instance of Compare .
Precondition
The number of unique elements in the range [first,last) is less than or equal to max_size() , else ARENE_PRECONDITION violation.

◆ inline_set() [6/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( Iterator first,
Iterator last,
Compare const & comp )
inlinenoexcept

Construct a set from the elements in the provided iterator range and comparator.

Template Parameters
IteratorThe type of the iterators. Must satisfy std::is_constructible<Value,std::iterator_traits<Iterator>::reference> .
Parameters
firstThe iterator to the first element in the range
lastThe iterator to the one-past-the-end element in the range
compThe comparator to use .
Postcondition
size() will be equal to the number of unique elements in the range [first,last)
The elements in the set will be the unique elements in the range [first,last) , sorted via comp .
Precondition
The number of unique elements in the range [first,last) is less than or equal to max_size() , else ARENE_PRECONDITION violation.

◆ inline_set() [7/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( inline_set< Value, Capacity, Compare > const & )
default

copy ctor.

◆ inline_set() [8/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( inline_set< Value, OtherCapacity, Compare > const & other)
inlinenoexcept

copy construct from a set with a smaller capacity

Participates in overload resolution if Value and Compare satisfy is_copy_constructible

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to copy from.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via copy-construction.

◆ inline_set() [9/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( inline_set< Value, OtherCapacity, Compare > const & other)
inlinenoexcept

copy construct from a set with a larger capacity

Participates in overload resolution if Value and Compare satisfy is_copy_constructible

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to copy from.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via copy-construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ inline_set() [10/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( move_construct_source && other)
inlinenoexcept

move ctor

Participates in overload resolution if Value satisfies is_move_constructible

Template Parameters
OtherCapacityThe maximum capacity of the other set to move from.
Parameters
otherThe set to move from
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-construction.

◆ inline_set() [11/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_move_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( inline_set< Value, OtherCapacity, Compare > && other)
inline

move construct from a set with a larger capacity

Participates in overload resolution if Value satisfies is_move_constructible

Template Parameters
OtherCapacityThe maximum capacity of the other set to move from.
Parameters
otherThe set to move from
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ inline_set() [12/12]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_move_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
arene::base::inline_set< Value, Capacity, Compare >::inline_set ( inline_set< Value, OtherCapacity, Compare > && other)
inlinenoexcept

move construct from a set with a smaller capacity

Participates in overload resolution if Value satisfies is_move_constructible

Template Parameters
OtherCapacityThe maximum capacity of the other set to move from.
Parameters
otherThe set to move from
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-construction.

Member Function Documentation

◆ begin()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::begin ( ) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to the beginning of the sorted range of elements.

Returns
const_iterator Points to the first element in the sequence, or end() if empty() .

◆ cbegin()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::cbegin ( ) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to the beginning of the sorted range of elements.

Returns
const_iterator Points to the first element in the sequence, or end() if empty() .

◆ cend()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::cend ( ) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to one past the last element in the sorted range of elements.

Returns
const_iterator Points to one past the last element in the sequence.

◆ clear()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
void arene::base::inline_set< Value, Capacity, Compare >::clear ( )
inlinenoexcept

Erase all the elements in *this.

Postcondition
size()==0 .
The destructors of all elements in the range [begin(),end()) will have been called once.

◆ contains() [1/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::contains ( OtherKey const & value) const -> bool
inlinenoexcept

Check if the set contains a value equivalent to a specific value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for
Returns
true if find(value)!=end() .
false if find(value)==end() .

◆ contains() [2/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::contains ( Value const & value_to_check) const -> bool
inlinenoexcept

Check if the set contains a specific value.

Parameters
value_to_checkThe value to search for
Returns
true if find(value_to_check)!=end() .
false if find(value_to_check)==end() .

◆ count() [1/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::count ( OtherKey const & value) const -> std::size_t
inlinenoexcept

Return the number of elements in the set equivalent to a specific value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for.
Returns
std::size_t 0 if the element was not in the set, else 1 .

◆ count() [2/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::count ( Value const & value_to_count) const -> std::size_t
inlinenoexcept

Return the number of elements in the set equivalent to a specific value.

Parameters
value_to_countThe value to search for.
Returns
std::size_t 0 if the element was not in the set, else 1 .

◆ crbegin()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::crbegin ( ) const -> const_reverse_iterator
inlinenoexcept

Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.

Returns
const_reverse_iterator Points to the last element in the sequence, or rend() if empty() .

◆ crend()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::crend ( ) const -> const_reverse_iterator
inlinenoexcept

Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.

Returns
const_reverse_iterator An iterator pointing to one before the first element in the sequence.

◆ emplace()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename... ArgTypes, constraints< std::enable_if_t< std::is_constructible< Value, ArgTypes &&... >::value > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::emplace ( ArgTypes &&... args) -> std::pair<iterator, bool>
inline

Construct a new element from the specified initialization arguments, and then attempt to insert it.

Template Parameters
ArgTypesThe types of the initialization arguments
Parameters
argsThe initialization arguments of the new element
Returns
std::pair<iterator, bool> Equivalent to calling insert(Value{ArgTypes...}) .

◆ empty()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::empty ( ) const -> bool
inlinenoexcept

Check if the set is empty.

Returns
true if the set does not hold any elements, false otherwise

◆ end()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::end ( ) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to one past the last element in the sorted range of elements.

Returns
const_iterator Points to one past the last element in the sequence.

◆ entry_at_index() [1/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::entry_at_index ( inline_set_detail::set_passkey ,
index_type index ) const -> entry_type const&
inlinenoexcept

Gets a reference to the element corrsponding to a given index.

Parameters
indexIndex of the element in iteration order.
Returns
A reference to the element for the given index.
Note
This can only be called from inline_set internals due to the passkey
Precondition
index<indicies.size()

◆ entry_at_index() [2/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::entry_at_index ( inline_set_detail::set_passkey ,
index_type index ) -> entry_type&
inlinenoexcept

Gets a reference to the element corrsponding to a given index.

Parameters
indexIndex of the element in iteration order.
Returns
A reference to the element for the given index.
Note
This can only be called from inline_set internals due to the passkey
Precondition
index<indicies.size()

◆ equal_range() [1/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::equal_range ( OtherKey const & value) const -> std::pair<const_iterator, const_iterator>
inlinenoexcept

Finds the sequence of values which compare equivalent to a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for
Returns
std::pair<const_iterator, const_iterator> A pair of iterators such that all values in the range [first,second) compare equal to value if there was an element equivalent to value in the set. Otherwise both iterators will be end() .

◆ equal_range() [2/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::equal_range ( OtherKey const & value) -> std::pair<iterator, iterator>
inlinenoexcept

Finds the sequence of values which compare equivalent to a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for
Returns
std::pair<iterator, iterator> A pair of iterators such that all values in the range [first,second) compare equal to value if there was an element equivalent to value in the set. Otherwise both iterators will be end() .

◆ equal_range() [3/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::equal_range ( Value const & value_to_find) const -> std::pair<const_iterator, const_iterator>
inlinenoexcept

Finds the sequence of values which compare equivalent to a given value.

Parameters
value_to_findThe value to search for
Returns
std::pair<const_iterator, const_iterator> A pair of iterators such that all values in the range [first,second) compare equal to value_to_find if there was an element equivalent to value_to_find in the set. Otherwise both iterators will be end() .

◆ equal_range() [4/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::equal_range ( Value const & value_to_find) -> std::pair<iterator, iterator>
inlinenoexcept

Finds the sequence of values which compare equivalent to a given value.

Parameters
value_to_findThe value to search for
Returns
std::pair<iterator, iterator> A pair of iterators such that all values in the range [first,second) compare equal to value_to_find if there was an element equivalent to value_to_find in the set. Otherwise both iterators will be end() .

◆ erase() [1/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::erase ( iterator first,
iterator last ) -> iterator
inlinenoexcept

Erase all the elements referred to be the specified iterator range.

Parameters
firstThe iterator for the start of the range
lastThe iterator for one-past-the-end of the range
Returns
An iterator referring to the element after the erased elements if there is one, or end() otherwise.
Precondition
(first,last] Must be a valid iterator range into *this

◆ erase() [2/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::erase ( iterator pos) -> iterator
inlinenoexcept

Erase the element referred to be the specified iterator.

Parameters
posThe iterator referring to the element to erase
Returns
An iterator referring to the element after the erased element if there is one, or end() otherwise.
Precondition
pos Must be a deferencable iterator into *this

◆ erase() [3/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::erase ( OtherKey const & value) -> size_type
inlinenoexcept

Erase any elements with a value equivalent to the supplied element.

Template Parameters
OtherKeyThe type of the element to erase.
Parameters
valueThe value of elements to erase
Returns
The number of elements erased, which will be 1 if the element was in the set, else 0 .

◆ erase() [4/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::erase ( Value const & value_to_erase) -> size_type
inlinenoexcept

Erase any elements with a value equivalent to the supplied element.

Parameters
value_to_eraseThe value of elements to erase
Returns
The number of elements erased, which will be 1 if the element was in the set, else 0 .

◆ fast_inequality_check()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<size_type OtherCapacity>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::fast_inequality_check ( inline_set< Value, Capacity, Compare > const & lhs,
inline_set< Value, OtherCapacity, Compare > const & rhs ) -> inequality_heuristic
inlinestaticnoexcept

Fast inequality heuristic to shortcut on different sized containers.

Template Parameters
OtherCapacitythe capacity of rhs
Parameters
lhsThe left-hand operand to the check
rhsThe right-hand operand to the check
Returns
inequality_heuristic::may_be_equal_or_not_equal if lhs.size()==rhs.size()
inequality_heuristic::definitely_not_equal if lhs.size()!=rhs.size()

◆ find() [1/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::find ( OtherKey const & value) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to the element equivalent to the supplied value, if there is one.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to find
Returns
const_iterator to the equivalent element, or end() if the element is not found

◆ find() [2/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::find ( OtherKey const & value) -> iterator
inlinenoexcept

Obtain an iterator referring to the element equivalent to the supplied value, if there is one.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to find
Returns
iterator to the equivalent element, or end() if the element is not found

◆ find() [3/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::find ( Value const & value_to_find) const -> const_iterator
inlinenoexcept

Obtain an iterator referring to the element equivalent to the supplied value, if there is one.

Parameters
value_to_findThe value to find
Returns
const_iterator to the equivalent element, or end() if the element is not found

◆ find() [4/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::find ( Value const & value_to_find) -> iterator
inlinenoexcept

Obtain an iterator referring to the element equivalent to the supplied value, if there is one.

Parameters
value_to_findThe value to find
Returns
iterator to the equivalent element, or end() if the element is not found

◆ get_comparator_base() [1/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::get_comparator_base ( inline_set_detail::set_passkey ) const -> comparator_base const&
inlinenoexcept

Get the comparator base.

Note
This can only be called from inline_set internals due to the passkey
Returns
A reference to the base

◆ get_comparator_base() [2/2]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::get_comparator_base ( inline_set_detail::set_passkey ) -> comparator_base&
inlinenoexcept

Get the comparator base.

Note
This can only be called from inline_set internals due to the passkey
Returns
A reference to the base

◆ insert() [1/5]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
void arene::base::inline_set< Value, Capacity, Compare >::insert ( Iterator first,
Iterator last )
inlinenoexcept

Insert all the elements in the provided iterator range into the set, if there are not already equivalent elements.

Template Parameters
IteratorThe type of the iterators
Parameters
firstThe iterator to the first element in the range
lastThe iterator to the one-past-the-end element in the range
Postcondition
size() increases by the number of elements in [first,last) which did not already exist in the set.
find(*itr) will return an iterator other than end() for all elements in the range [first,last)
Precondition
Let unique_elements equal the number of elements in the range [first,last) for which contains(*itr) would return false ; size()+unique_elements<=max_size() , else ARENE_PRECONDITION violation .

◆ insert() [2/5]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, typename SfinaeKey = Value, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > >, std::enable_if_t<!std::is_integral< SfinaeKey >::value >, std::enable_if_t< std::is_constructible< Value, OtherKey && >::value > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::insert ( OtherKey && value) -> std::pair<iterator, bool>
inlinenoexcept

Attempt to insert an element into the set.

Template Parameters
OtherKeyThe type of the element to attempt to insert. Must satisfy std::is_constructible<Value,OtherKey&&>
Parameters
valueThe element to insert via perfect forwarding.
Returns
std::pair<iterator,bool> A pair where the first element is an iterator pointing to either the newly inserted element at its sort-order position in the set, or the existing element in the set if the set already contained value , and the second element is a boolean which is true if the insertion happened, or false otherwise.
Postcondition
If the insertion happened, size() increases by 1.
If the insertion happened, there is an element equivalent to value in the set at the position referenced by the returned iterator.
Precondition
size()+1<=max_size() , else ARENE_PRECONDITION violation .

◆ insert() [3/5]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
void arene::base::inline_set< Value, Capacity, Compare >::insert ( std::initializer_list< Value > init)
inline

Attempt to insert the elements in the provided initializer list into the set.

Parameters
initThe list of elements to insert
Postcondition
size() increases by the number of elements in init which did not already exist in the set.
find(*itr) wil return an iterator other than end() for all elements in init
Precondition
Let unique_elements equal the number of elements in init for which contains() would return false ; size()+unique_elements<=max_size() , else ARENE_PRECONDITION violation .

◆ insert() [4/5]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::insert ( Value && value_to_insert) -> std::pair<iterator, bool>
inlinenoexcept

Attempt to insert an element into the set.

Parameters
value_to_insertThe element to insert via move-construction
Returns
std::pair<iterator,bool> A pair where the first element is an iterator pointing to either the newly inserted element at its sort-order position in the set, or the existing element in the set if the set already contained value_to_insert , and the second element is a boolean which is true if the insertion happened, or false otherwise.
Postcondition
If the insertion happened, size() increases by 1.
If the insertion happened, there is an element equivalent to value_to_insert in the set at the position referenced by the returned iterator.
Precondition
size()+1<=max_size() , else ARENE_PRECONDITION violation .

◆ insert() [5/5]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::insert ( Value const & value_to_insert) -> std::pair<iterator, bool>
inlinenoexcept

Attempt to insert an element into the set.

Parameters
value_to_insertThe element to insert via copy-construction
Returns
std::pair<iterator,bool> A pair where the first element is an iterator pointing to either the newly inserted element at its sort-order position in the set, or the existing element in the set if the set already contained value_to_insert , and the second element is a boolean which is true if the insertion happened, or false otherwise.
Postcondition
If the insertion happened, size() increases by 1.
If the insertion happened, there is an element equivalent to value_to_insert in the set at the position referenced by the returned iterator.
Precondition
size()+1<=max_size() , else ARENE_PRECONDITION violation .

◆ key_comp()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::key_comp ( ) const -> key_compare
inlinenoexcept

Get the comparator.

Returns
A copy of the comparator

◆ lower_bound() [1/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::lower_bound ( OtherKey const & value) const -> const_iterator
inlinenoexcept

Find the first element which is not less than a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to find the lower bound for.
Returns
const_iterator to the first element which is not less than value , or end() if there is no such element.

◆ lower_bound() [2/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::lower_bound ( OtherKey const & value) -> iterator
inlinenoexcept

Find the first element which is not less than a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to find the lower bound for.
Returns
iterator to the first element which is not less than value , or end() if there is no such element.

◆ lower_bound() [3/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::lower_bound ( Value const & value_to_find) const -> const_iterator
inlinenoexcept

Find the first element which is not less than a given value.

Parameters
value_to_findThe value to find the lower bound for.
Returns
const_iterator to the first element which is not less than value_to_find, or end() if there is no such element.

◆ lower_bound() [4/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::lower_bound ( Value const & value_to_find) -> iterator
inlinenoexcept

Find the first element which is not less than a given value.

Parameters
value_to_findThe value to find the lower bound for.
Returns
iterator to the first element which is not less than value_to_find, or end() if there is no such element.

◆ operator=() [1/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( copy_assign_source const & other) -> inline_set&
inlinenoexcept

copy-assignment operator.

Participates in overload resolution if Value satisfies std::is_copy_constructible and Compare satisfies is_copy_assignable

Template Parameters
OtherCapacitythe capacity of the other set.
Parameters
otherThe set to copy-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via copy-assignment/construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ operator=() [2/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( deleted_copy_assign_source const & other) -> inline_set &=delete
delete

Deleted copy-assignment operator where the set is not copy-assignable.

◆ operator=() [3/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( deleted_move_assign_source && ) -> inline_set &=delete
delete

The move assignment operator is deleted if move assignment is not supported.

◆ operator=() [4/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_move_assignable< inline_set< Value, OtherCapacity, Compare > >::value >>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( inline_set< Value, OtherCapacity, Compare > && other) -> inline_set&
inline

move-assignment operator from an inline_set with a larger capacity

Participates in overload resolution if Value satisfies is_move_constructible, and Compare satisfies std::is_move_assignable

Template Parameters
OtherCapacityThe capacity of the source set
Parameters
otherThe set to move-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-assignment/construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ operator=() [5/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_move_assignable< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( inline_set< Value, OtherCapacity, Compare > && other) -> inline_set&
inlinenoexcept

move-assignment operator from an inline_set with a smaller capacity

Participates in overload resolution if Value satisfies is_move_constructible, and Compare satisfies std::is_move_assignable

Template Parameters
OtherCapacityThe capacity of the source set
Parameters
otherThe set to move-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-assignment/construction.

◆ operator=() [6/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity< Capacity)>, std::enable_if_t< std::is_copy_assignable< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( inline_set< Value, OtherCapacity, Compare > const & other) -> inline_set&
inlinenoexcept

copy-assignment operator for copying from a set with a smaller capacity

Participates in overload resolution if Value satisfies std::is_copy_constructible and Compare satisfies is_copy_assignable

Template Parameters
OtherCapacitythe capacity of the other set.
Parameters
otherThe set to copy-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via copy-assignment/construction.

◆ operator=() [7/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_assignable< inline_set< Value, OtherCapacity, Compare > >::value >>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( inline_set< Value, OtherCapacity, Compare > const & other) -> inline_set&
inlinenoexcept

copy-assignment operator for copying from a set with a larger capacity

Participates in overload resolution if Value satisfies std::is_copy_constructible and Compare satisfies is_copy_assignable

Template Parameters
OtherCapacitythe capacity of the other set.
Parameters
otherThe set to copy-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via copy-assignment/construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ operator=() [8/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::operator= ( move_assign_source && other) -> inline_set&
inlinenoexcept

move-assignment operator

Participates in overload resolution if Value satisfies is_move_constructible, and Compare satisfies std::is_move_assignable

Parameters
otherThe set to move-assign from.
Returns
inline_set& The set post-assignment.
Postcondition
size()==other.size()
The elements in the set will be equivalent to the elements that were in other , produced as if via move-assignment/construction.
Precondition
other.size()<=maximum_size() else ARENE_PRECONDITION violation.

◆ rbegin()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::rbegin ( ) const -> const_reverse_iterator
inlinenoexcept

Obtain an iterator referring to the beginning of a reversed traversal of the sorted range of elements.

Returns
const_reverse_iterator Points to the last element in the sequence, or rend() if empty() .

◆ rend()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::rend ( ) const -> const_reverse_iterator
inlinenoexcept

Obtain an iterator referring to one past the last element in a reversed traversal of the sorted range of elements.

Returns
const_reverse_iterator An iterator pointing to one before the first element in the sequence.

◆ size()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::size ( ) const -> std::size_t
inlinenoexcept

Get the number of elements in the set.

Returns
The number of elements in the set

◆ three_way_compare()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<size_type OtherCapacity, typename SfinaeKey = key_type, constraints< std::enable_if_t< compare_three_way_supported_v< SfinaeKey > > > = nullptr>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::three_way_compare ( inline_set< Value, Capacity, Compare > const & lhs,
inline_set< Value, OtherCapacity, Compare > const & rhs ) -> strong_ordering
inlinestaticnoexcept

Compares two sets lexicographically .

Note
Lexicographic comparison between sets ignores the order of keys as defined by Compare . That is, it is a lexicographic comparison between the value_type elements of each container, in iteration order, using the standard compare_three_way facility. This means that for all possible sets which result in element sequences {1, 2, 3} and {1, 2, 5}, when compared against each other the result of the comparison will always be the same, strong_ordering::less.
Template Parameters
OtherCapacitythe capacity of rhs
SfinaeKeydummy template parameter to disable the operator if key_Type is not three way comparable.
Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
strong_ordering Equivalent to arene::base::lexicographical_compare_three_way(lhs.begin(),lhs.end(),rhs.begin(),rhs.end())

◆ try_construct() [1/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( inline_set< Value, OtherCapacity, Compare > && other) -> optional<inline_set>
inlinestaticnoexcept

Attempts to construct a set via move-construction from a set with a larger capacity.

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to move from.
Returns
If other.size()<=Capacity , then will return a populated optional equivalent to inline_set{other} . Otherwise returns a null optional.

◆ try_construct() [2/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity<=Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( inline_set< Value, OtherCapacity, Compare > && other) -> optional<inline_set>
inlinestaticnoexcept

Attempts to construct a set via move-construction from a set with a capacity that is less than or equal to the target capacity.

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to move from.
Returns
A populated optional equivalent to inline_set{other} .

◆ try_construct() [3/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity<=Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value > > = nullptr>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( inline_set< Value, OtherCapacity, Compare > const & other) -> optional<inline_set>
inlinestaticnoexcept

Attempts to construct a set via copy-construction from a set with the same or smaller capacity.

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to copy from.
Returns
A populated optional equivalent to inline_set{other}

◆ try_construct() [4/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<std::size_t OtherCapacity, constraints< std::enable_if_t<(OtherCapacity > Capacity)>, std::enable_if_t< std::is_copy_constructible< inline_set< Value, OtherCapacity, Compare > >::value >>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( inline_set< Value, OtherCapacity, Compare > const & other) -> optional<inline_set>
inlinestaticnoexcept

Attempts to construct a set from a set with a larger capacity.

Template Parameters
OtherCapacityThe capacity of the other set
Parameters
otherThe set to copy from.
Returns
optional<inline_set> If other.size()<=Capacity , then will return a populated optional equivalent to inline_set{other} . Otherwise returns a null optional.

◆ try_construct() [5/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( Iterator first,
Iterator last ) -> optional<inline_set>
inlinestaticnoexcept

Attempt to construct a set from the specified sequence of values.

Template Parameters
IteratorThe type of the iterators. Must satisfy std::is_constructible<Value,std::iterator_traits<Iterator>::reference> .
Parameters
firstThe iterator to the first element in the range
lastThe iterator to the one-past-the-end element in the range
Returns
optional<inline_set> If the number of unique elements in the range [first,last) is less than or equal to Capacity , then will return a populated optional equivalent to inline_set{first,last} . Otherwise returns a null optional.

◆ try_construct() [6/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename Iterator, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< std::is_constructible< Value, typename std::iterator_traits< Iterator >::reference >::value > > = nullptr>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( Iterator first,
Iterator last,
Compare const & comp ) -> optional<inline_set>
inlinestaticnoexcept

Attempt to construct a set from the specified sequence of values and a comparator.

Template Parameters
IteratorThe type of the iterators. Must satisfy std::is_constructible<Value,std::iterator_traits<Iterator>::reference> .
Parameters
firstThe iterator to the first element in the range
lastThe iterator to the one-past-the-end element in the range
compThe comparator to use .
Returns
optional<inline_set> If the number of unique elements in the range [first,last) is less than or equal to Capacity , then will return a populated optional equivalent to inline_set{first,last} . Otherwise returns a null optional.

◆ try_construct() [7/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( std::initializer_list< Value > init) -> optional<inline_set>
inlinestaticnoexcept

Attempt to construct a set from the specified list of values.

Parameters
initThe list of elements to store in the set
Returns
optional<inline_set> If the number of unique elements in init is less than or equal to Capacity , then will return a populated optional equivalent to inline_set{init} . Otherwise returns a null optional.

◆ try_construct() [8/8]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
static ARENE_NODISCARD auto arene::base::inline_set< Value, Capacity, Compare >::try_construct ( std::initializer_list< Value > init,
Compare const & comp ) -> optional<inline_set>
inlinestaticnoexcept

Attempt to construct a set from the specified list of values and a comparator.

Parameters
initThe list of elements to store in the set
compThe comparator to use.
Returns
optional<inline_set> If the number of unique elements in init is less than or equal to Capacity , then will return a populated optional equivalent to inline_set{init,comp} . Otherwise returns a null optional.

◆ upper_bound() [1/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::upper_bound ( OtherKey const & value) const -> const_iterator
inlinenoexcept

Find the first element which is greater than a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for.
Returns
const_iterator to the first element which is greater than value , or end() if there is no such element.

◆ upper_bound() [2/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
template<typename OtherKey, constraints< std::enable_if_t< transparent_comparison_supported_for< OtherKey > > > = nullptr>
auto arene::base::inline_set< Value, Capacity, Compare >::upper_bound ( OtherKey const & value) -> iterator
inlinenoexcept

Find the first element which is greater than a given value.

Template Parameters
OtherKeythe type of the value to find. Must satisfy is_transparent_comparator_for<Compare,Value,K> or is_transparent_three_way_comparator_for<Compare,Value,K> .
Parameters
valueThe value to search for.
Returns
iterator to the first element which is greater than value , or end() if there is no such element.

◆ upper_bound() [3/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::upper_bound ( Value const & value_to_find) const -> const_iterator
inlinenoexcept

Find the first element which is greater than a given value.

Parameters
value_to_findThe value to search for.
Returns
const_iterator to the first element which is greater than value_to_find , or end() if there is no such element.

◆ upper_bound() [4/4]

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::upper_bound ( Value const & value_to_find) -> iterator
inlinenoexcept

Find the first element which is greater than a given value.

Parameters
value_to_findThe value to search for.
Returns
iterator to the first element which is greater than value_to_find , or end() if there is no such element.

◆ value_comp()

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
auto arene::base::inline_set< Value, Capacity, Compare >::value_comp ( ) const -> value_compare
inlinenoexcept

Get the comparator.

Returns
A copy of the comparator

Member Data Documentation

◆ capacity

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
std::integral_constant<size_type, Capacity> arene::base::inline_set< Value, Capacity, Compare >::capacity {}
staticconstexpr

The maximum number of elements that can be held in the set.

Returns
size_t Equivalent to Capacity .

◆ max_size

template<typename Value, std::size_t Capacity, typename Compare = compare_three_way>
std::integral_constant<size_type, Capacity> arene::base::inline_set< Value, Capacity, Compare >::max_size {}
staticconstexpr

Get the maximum number of elements in the set.

Returns
size_t Equivalent to Capacity .

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