libhatchet
Loading...
Searching...
No Matches
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > Class Template Reference

#include <hxflat_set.hpp>

Public Types

using key_t = key_t_
using compare_t = compare_t_
using iterator = const key_t_*
using const_iterator = const key_t_*

Public Member Functions

 hxflat_set (void)
 hxflat_set (const hxflat_set &x_) noexcept
 hxflat_set (hxflat_set &&x_) noexcept
 hxflat_set (std::initializer_list< key_t_ > x_) noexcept
 ~hxflat_set (void) noexcept
template<typename self_t_, typename callable_t_>
auto and_then (this self_t_ &&self_, const key_t_ &key_, callable_t_ &&callable_) -> hxremove_cvref_t< decltype(hxforward< callable_t_ >(callable_)(hxforward_like< self_t_ >(hxdeclval< const key_t_ & >())))>
template<typename self_t_, typename callable_t_>
auto and_then (this self_t_ &&self_, const key_t_ *it_, callable_t_ &&callable_) -> hxremove_cvref_t< decltype(hxforward< callable_t_ >(callable_)(hxforward_like< self_t_ >(hxdeclval< const key_t_ & >())))>
void operator= (const hxflat_set &x_) noexcept
template<hxsize_t capacity_x_>
void operator= (const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > &x_) noexcept
void operator= (hxflat_set &&x_) noexcept
const key_t_ * operator[] (hxsize_t index_) const
template<hxsize_t capacity_x_>
bool operator== (const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > &x_) const
template<hxsize_t capacity_x_>
bool operator< (const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > &x_) const
template<hxrange_concept_ range_t_>
void add_range (range_t_ &range_) noexcept
template<hxrange_concept_ range_t_, hxenable_if_t<!hxis_lvalue_reference< range_t_ >(), int > = 0>
void add_range (range_t_ &&range_) noexcept
const key_t_ * begin (void) const
hxsize_t capacity (void) const
const key_t_ * cbegin (void) const
const key_t_ * cend (void) const
void clear (void) noexcept
hxsize_t count (const key_t_ &key_) const
template<typename... args_t_>
const key_t_ * emplace (args_t_ &&... args_) noexcept
bool empty (void) const
const key_t_ * end (void) const
hxsize_t erase (const key_t_ &key_) noexcept
const key_t_ * erase (const key_t_ *it_) noexcept
const key_t_ * find (const key_t_ &key_) const
bool full (void) const
bool has_value (const key_t_ &key_) const
const key_t_ * insert (const key_t_ &key_) noexcept
const key_t_ * insert (key_t_ &&key_) noexcept
const key_t_ * keys (void) const noexcept
const key_t_ * lower_bound (const key_t_ &key_) const
hxsize_t max_size (void) const
template<typename self_t_, typename callable_t_>
auto or_else (this self_t_ &&self_, const key_t_ &key_, callable_t_ &&callable_) -> decltype(self_.end())
template<typename self_t_, typename callable_t_>
auto or_else (this self_t_ &&self_, const key_t_ *it_, callable_t_ &&callable_) -> decltype(self_.end())
void reserve (hxsize_t cap_, hxsystem_allocator_t allocator_=hxsystem_allocator_current, hxalignment_t alignment_=hxalignment)
hxsize_t size (void) const
void swap (hxflat_set &x_) noexcept
const key_t_ * upper_bound (const key_t_ &key_) const
template<typename self_t_, typename... args_t_>
key_t_ value_or (this self_t_ &&self_, const key_t_ &key_, args_t_ &&... args_)
template<typename self_t_, typename... args_t_>
key_t_ value_or (this self_t_ &&self_, const key_t_ *it_, args_t_ &&... args_)

Detailed Description

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
class hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >

hxflat_set - A sorted associative container that stores keys in a single array.

Lookup is O(log n) via binary search. Insert and erase are O(n) because elements are shifted to maintain order. This design keeps keys cache-friendly and avoids heap overhead per element.

When multi_t is false duplicate keys are rejected and insert returns a pointer to the existing element. When multi_t is true duplicate keys are always inserted. compare_t must be a callable with signature bool(const key_t_&, const key_t_&) returning true when the first argument is ordered before the second. It defaults to hxkey_less_t.

When capacity is hxallocator_dynamic_capacity storage must be allocated by calling reserve before inserting elements. Otherwise the array is statically sized to capacity elements and reserve may only be called with exactly that value. extract() is not provided, just use data().

E.g.:

// A static flat set of 64 integers.
hxflat_set(void)
Constructs an empty set.

Member Typedef Documentation

◆ compare_t

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
using hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::compare_t = compare_t_

◆ const_iterator

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
using hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::const_iterator = const key_t_*

const_iterator - Const random access iterator over keys.

◆ iterator

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
using hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::iterator = const key_t_*

iterator - Const random access iterator over keys.

◆ key_t

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
using hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::key_t = key_t_

Constructor & Destructor Documentation

◆ hxflat_set() [1/4]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::hxflat_set ( void )
explicit

Constructs an empty set.

Requires reserve before inserting when capacity is hxallocator_dynamic_capacity.

◆ hxflat_set() [2/4]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::hxflat_set ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > & x_)
noexcept

Copy constructs from another hxflat_set.

Requires x.size() ≤ capacity().

◆ hxflat_set() [3/4]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::hxflat_set ( hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > && x_)
noexcept

Move constructs from a temporary hxflat_set.

Requires hxallocator_dynamic_capacity.

◆ hxflat_set() [4/4]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::hxflat_set ( std::initializer_list< key_t_ > x_)
noexcept

Constructs a set by inserting every key from x in order using insert.

Requires x.size() <= capacity when capacity is fixed.

  • x : A std::initializer_list<key_t>.

◆ ~hxflat_set()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::~hxflat_set ( void )
noexcept

Destructs the set and destroys all keys.

Member Function Documentation

◆ add_range() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<hxrange_concept_ range_t_, hxenable_if_t<!hxis_lvalue_reference< range_t_ >(), int > = 0>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::add_range ( range_t_ && range_)
noexcept

Inserts every key from a temporary range by moving each key with insert.

This overload enables moving the range keys into the set when forwarding rvalues.

  • range : The range to move keys from.

◆ add_range() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<hxrange_concept_ range_t_>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::add_range ( range_t_ & range_)
noexcept

Inserts every key from a range referenced by an lvalue by copying each key with insert.

  • range : The range to copy keys from.

◆ and_then() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename callable_t_>
auto hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::and_then ( this self_t_ && self_,
const key_t_ & key_,
callable_t_ && callable_ )->hxremove_cvref_t< decltype(hxforward< callable_t_ >(callable_)(hxforward_like< self_t_ >(hxdeclval< constkey_t_ & >())))>

Returns the result of calling callable with the first key matching key, otherwise returns hxnil.

Use and_then to return hxptr, hxref or hxexpected.

  • key : The key to search for.
  • callable : The function to call with the found key.

◆ and_then() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename callable_t_>
auto hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::and_then ( this self_t_ && self_,
const key_t_ * it_,
callable_t_ && callable_ )->hxremove_cvref_t< decltype(hxforward< callable_t_ >(callable_)(hxforward_like< self_t_ >(hxdeclval< constkey_t_ & >())))>

Iterator overload of and_then.

  • it : An iterator to a key or end().
  • callable : The function to call with the key.

◆ begin()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::begin ( void ) const
inline

Returns a const pointer to the first element.

◆ capacity()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::capacity ( void ) const

Returns the capacity of the set or 0 if unallocated.

◆ cbegin()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::cbegin ( void ) const
inline

Returns a const pointer to the first element (alias for begin).

◆ cend()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::cend ( void ) const
inline

Returns a const pointer past the last element.

◆ clear()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::clear ( void )
noexcept

Removes all elements and destroys their keys.

◆ count()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::count ( const key_t_ & key_) const

Returns the number of elements with the given key.

  • key : The key to count.

◆ emplace()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename... args_t_>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::emplace ( args_t_ &&... args_)
noexcept

Constructs and inserts a key from args, returning a pointer to the new or existing key.

  • args : Arguments forwarded to the key constructor.

◆ empty()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::empty ( void ) const
inline

Checks if the set contains no elements.

◆ end()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::end ( void ) const
inline

Returns a const pointer past the last element.

◆ erase() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::erase ( const key_t_ & key_)
noexcept

Removes all elements with the given key and destroys their keys.

Returns the number of elements removed.

  • key : The key to search for and remove.

◆ erase() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::erase ( const key_t_ * it_)
noexcept

Removes the element at the pointer position and destroys the key.

Returns a const pointer to the element that followed the erased one.

  • it : A const pointer to an element in this set.

◆ find()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::find ( const key_t_ & key_) const

Returns a const pointer to the key if found, or end() if not present.

When multi_t is true the first match is returned.

  • key : The key to search for.

◆ full()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::full ( void ) const
inline

Returns true if the set has reached its capacity.

◆ has_value()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
bool hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::has_value ( const key_t_ & key_) const

Returns true if a key matching key exists.

  • key : The key to search for.

◆ insert() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::insert ( const key_t_ & key_)
noexcept

Inserts a key.

When multi_t is false and a matching key already exists, returns a const pointer to the existing element without inserting. Otherwise inserts in sorted order and returns a const pointer to the new element.

  • key : The key to insert.

◆ insert() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::insert ( key_t_ && key_)
noexcept

◆ keys()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::keys ( void ) const
noexcept

Returns a const pointer to the underlying key storage.

The range [keys(), keys() + size()) contains the constructed elements.

◆ lower_bound()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::lower_bound ( const key_t_ & key_) const

Returns a const pointer to the first element whose key is not ordered before key.

Returns end if no such element exists.

  • key : The key to search for.

◆ max_size()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::max_size ( void ) const
inline

Returns the capacity of the set.

◆ operator<()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<hxsize_t capacity_x_>
bool hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator< ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > & x_) const

Returns true if this set compares less than x lexicographically, using hxkey_equal and hxkey_less on keys.

  • x : The set to compare against.

◆ operator=() [1/3]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator= ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > & x_)
noexcept

Assigns the contents of x to this set.

Clears this set then copies all elements from x. Requires x.size() ≤ capacity().

  • x : The set to copy from.

◆ operator=() [2/3]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<hxsize_t capacity_x_>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator= ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > & x_)
noexcept

Cross-capacity copy assignment.

Assigns the contents of x to this set. Requires x.size() ≤ capacity().

  • x : The set to copy from.

◆ operator=() [3/3]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator= ( hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > && x_)
noexcept

Move assigns from a temporary set using swap.

Requires hxallocator_dynamic_capacity.

  • x : A temporary set to move from.

◆ operator==()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<hxsize_t capacity_x_>
bool hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator== ( const hxflat_set< key_t_, compare_t_, multi_t_, capacity_x_ > & x_) const

Returns true if this set and x contain the same keys in the same order using hxkey_equal.

  • x : The set to compare against.

◆ operator[]()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::operator[] ( hxsize_t index_) const

Returns a const pointer to the element at index.

Requires index < size().

  • index : The 0-based position of the element.

◆ or_else() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename callable_t_>
auto hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::or_else ( this self_t_ && self_,
const key_t_ & key_,
callable_t_ && callable_ )->decltype(self_.end())

Returns a pointer to the first key matching key, or the result of calling callable when lookup fails.

  • key : The key to search for.
  • callable : The function to call when lookup fails. Must return a pointer to a key.

◆ or_else() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename callable_t_>
auto hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::or_else ( this self_t_ && self_,
const key_t_ * it_,
callable_t_ && callable_ )->decltype(self_.end())

Iterator overload of or_else.

  • it : An iterator to a key or end().
  • callable : The function to call for end(). Must return an iterator.

◆ reserve()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::reserve ( hxsize_t cap_,
hxsystem_allocator_t allocator_ = hxsystem_allocator_current,
hxalignment_t alignment_ = hxalignment )

Allocates storage for cap keys.

When capacity is fixed, cap must equal capacity. Reallocation is not allowed.

  • cap : The number of elements to allocate storage for.
  • allocator : The memory manager ID to use for allocation (default: hxsystem_allocator_current)
  • alignment : The alignment for the allocation. (default: hxalignment)

◆ size()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
hxsize_t hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::size ( void ) const
inline

Returns the number of elements in the set.

◆ swap()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
void hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::swap ( hxflat_set< key_t_, compare_t_, multi_t_, capacity_ > & x_)
noexcept

Swaps the contents with x.

Requires hxallocator_dynamic_capacity.

  • x : The set to swap with.

◆ upper_bound()

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
const key_t_ * hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::upper_bound ( const key_t_ & key_) const

Returns a const pointer to the first element whose key is ordered after key.

Returns end if no such element exists.

  • key : The key to search for.

◆ value_or() [1/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename... args_t_>
key_t_ hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::value_or ( this self_t_ && self_,
const key_t_ & key_,
args_t_ &&... args_ )

Returns a copy of the first key matching key, or a key constructed from args when lookup fails.

  • key : The key to search for.
  • args : The arguments used to construct the value when lookup fails.

◆ value_or() [2/2]

template<hxflat_set_concept_ key_t_, typename compare_t_ = hxkey_less_t<key_t_>, bool multi_t_ = true, hxsize_t capacity_ = hxallocator_dynamic_capacity>
template<typename self_t_, typename... args_t_>
key_t_ hxflat_set< key_t_, compare_t_, multi_t_, capacity_ >::value_or ( this self_t_ && self_,
const key_t_ * it_,
args_t_ &&... args_ )

Iterator overload of value_or.

  • it : An iterator to a key or end().
  • args : The arguments used to construct the value for end().

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