|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Ordered set stored as a sorted contiguous array. More...
#include <tpl_flat_set.H>
Public Types | |
| using | Item_Type = Key |
| Aleph convention: element type. | |
| using | Key_Type = Key |
| Aleph convention: key type. | |
| using | key_type = Key |
| STL convention: key type. | |
| using | value_type = Key |
| STL convention: value type. | |
| using | key_compare = Compare |
| STL convention: comparator type. | |
| using | size_type = size_t |
| STL convention: size type. | |
| using | iterator = const Key * |
| Random-access iterator (immutable). | |
| using | const_iterator = const Key * |
| Random-access const iterator. | |
Public Member Functions | |
| FlatSet (size_t cap=MemArray< Key >::Min_Dim) | |
| Construct an empty set. | |
| FlatSet (const Compare &cmp, size_t cap=MemArray< Key >::Min_Dim) | |
| Construct an empty set with a specific comparator. | |
| template<std::input_iterator It> | |
| FlatSet (It first, It last, const Compare &cmp=Compare()) | |
| Construct from an iterator range. | |
| FlatSet (std::initializer_list< Key > l, const Compare &cmp=Compare()) | |
| Construct from an initializer list. | |
| FlatSet (const FlatSet &)=default | |
Copy constructor (requires copyable Key). | |
| FlatSet (FlatSet &&) noexcept=default | |
| Move constructor. The source is left valid but unspecified. | |
| FlatSet & | operator= (const FlatSet &)=default |
Copy assignment (requires copyable Key). | |
| FlatSet & | operator= (FlatSet &&) noexcept=default |
| Move assignment. The source is left valid but unspecified. | |
| ~FlatSet ()=default | |
| void | swap (FlatSet &s) noexcept(std::is_nothrow_swappable_v< Compare >) |
Swap contents with s in O(1). | |
| size_t | size () const noexcept |
| Return the number of stored keys. O(1). | |
| bool | is_empty () const noexcept |
Return true if the set holds no keys. O(1). | |
| size_t | capacity () const noexcept |
| Return the capacity of the backing array. O(1). | |
| void | reserve (size_t cap) |
Reserve capacity for at least cap keys. | |
| void | empty () noexcept |
| Remove all keys (Aleph convention). | |
| void | clear () noexcept |
Remove all keys. Alias of empty(). Capacity is kept. | |
| const_iterator | find (const Key &k) const |
| Find a key. | |
| bool | contains (const Key &k) const |
| Test membership. | |
| size_t | count (const Key &k) const |
| Count occurrences of a key (0 or 1). | |
| const_iterator | lower_bound (const Key &k) const |
First element not less than k. | |
| const_iterator | upper_bound (const Key &k) const |
First element greater than k. | |
| std::pair< const_iterator, const_iterator > | equal_range (const Key &k) const |
Range of elements equivalent to k. | |
| const Key & | nth (size_t i) const |
| Positional access to the i-th smallest key (checked). | |
| const Key & | operator() (size_t i) const noexcept |
| Positional access without bounds checking. | |
| const Key & | get_first () const |
| Smallest key (checked). | |
| const Key & | get_last () const |
| Greatest key (checked). | |
| const Key & | min () const |
Smallest key (checked). Alias of get_first(). | |
| const Key & | max () const |
Greatest key (checked). Alias of get_last(). | |
| std::pair< const_iterator, bool > | insert (const Key &k) |
Insert a copy of k if no equivalent key exists. | |
| std::pair< const_iterator, bool > | insert (Key &&k) |
Insert k by moving if no equivalent key exists. | |
| template<class... Args> | |
| std::pair< const_iterator, bool > | emplace (Args &&...args) |
| Construct a key in place and insert it. | |
| size_t | erase (const Key &k) |
Remove the key equivalent to k, if present. | |
| const_iterator | erase (const_iterator it) |
Remove the key at iterator it. | |
| const_iterator | begin () const noexcept |
| Iterator to the smallest key. O(1). | |
| const_iterator | end () const noexcept |
| Iterator past the greatest key. O(1). | |
| const_iterator | cbegin () const noexcept |
| Const iterator to the smallest key. O(1). | |
| const_iterator | cend () const noexcept |
| Const iterator past the greatest key. O(1). | |
| const Key * | data () const noexcept |
| Pointer to the underlying sorted, contiguous storage. O(1). | |
| template<class Operation > | |
| bool | traverse (Operation operation) const |
Traverse keys in sorted order while operation returns true. | |
| bool | operator== (const FlatSet &s) const |
| Equality: same size and pairwise equal elements. | |
| bool | operator!= (const FlatSet &s) const |
Inequality: negation of operator==. | |
Private Member Functions | |
| size_t | lower_idx (const Key &k) const |
| size_t | upper_idx (const Key &k) const |
| bool | match_at (size_t pos, const Key &k) const |
| template<class Op > | |
| void | keeping_invariants (Op &&op) |
| void | grow_to (const size_t cap) |
| void | make_room (const size_t pos) |
| template<class K > | |
| void | insert_at (const size_t pos, K &&k) |
| void | remove_at (const size_t pos) |
| void | sort_and_unique () |
Private Attributes | |
| MemArray< Key > | keys_ |
| Compare | cmp_ |
Static Private Attributes | |
| static constexpr bool | nothrow_relocation |
Ordered set stored as a sorted contiguous array.
Keys are kept sorted according to Compare inside a MemArray<Key>. All lookup operations are binary searches over contiguous memory; all mutating operations preserve the sorted invariant by shifting elements.
Duplicate keys (keys equivalent under Compare) are not stored: an insertion of an equivalent key leaves the set unchanged.
| Key | Type of the stored keys. Must be default-constructible, move-constructible and move-assignable (requirements inherited from MemArray). |
| Compare | Strict weak ordering over Key. Defaults to Aleph::less<Key>. |
const Key * pointers (contiguous, random access). As with std::set, elements are immutable through iterators: mutating a key in place would break the sorted invariant. Any insertion or removal invalidates all iterators.Array), empty() clears the container and is_empty() is the emptiness predicate.Key can be move-constructed and move-assigned without throwing, insert, emplace and reserve offer the strong guarantee: the key is copied before the array changes, so the only possible failure afterwards is an allocation that leaves the keys untouched. erase then always removes the element; a failed shrinking reallocation is ignored.If moving a key can throw, an exception thrown while keys are shifted or relocated would leave a moved-from or duplicated key. The set is then emptied, which restores its invariants as std::flat_set does, and the exception is rethrown: the guarantee is basic. This applies to the operations above and to erase.
A failed allocation or a capacity out of range is not such an exception: the insertions and reserve obtain the new buffer before they move any key, so the set keeps its contents whatever the type. This does not hold for erase when moving can throw: there a shrinking reallocation that fails cannot be told apart from a move that throws, and it empties the set as well.
Definition at line 143 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::const_iterator = const Key * |
Random-access const iterator.
Definition at line 321 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::Item_Type = Key |
Aleph convention: element type.
Definition at line 314 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::iterator = const Key * |
Random-access iterator (immutable).
Definition at line 320 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::key_compare = Compare |
STL convention: comparator type.
Definition at line 318 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::Key_Type = Key |
Aleph convention: key type.
Definition at line 315 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::key_type = Key |
STL convention: key type.
Definition at line 316 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::size_type = size_t |
STL convention: size type.
Definition at line 319 of file tpl_flat_set.H.
| using Aleph::FlatSet< Key, Compare >::value_type = Key |
STL convention: value type.
Definition at line 317 of file tpl_flat_set.H.
|
inlineexplicit |
Construct an empty set.
| cap | Initial capacity hint (rounded up to a power of two by the backing MemArray). |
| std::bad_alloc | if the initial buffer cannot be allocated. |
Definition at line 329 of file tpl_flat_set.H.
|
inlineexplicit |
Construct an empty set with a specific comparator.
| cmp | Comparator instance to copy. |
| cap | Initial capacity hint. |
| std::bad_alloc | if the initial buffer cannot be allocated. |
Definition at line 337 of file tpl_flat_set.H.
|
inline |
Construct from an iterator range.
Loads all elements, then sorts once and removes duplicates: O(m log m) for m input elements, which beats m individual O(n) insertions.
| It | Input iterator whose value type converts to Key. |
| first | Beginning of the range. |
| last | End of the range. |
| cmp | Comparator instance (defaulted). |
| std::bad_alloc | if memory allocation fails. |
Definition at line 353 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::keys_, Aleph::MemArray< T >::put(), and Aleph::FlatSet< Key, Compare >::sort_and_unique().
|
inline |
Construct from an initializer list.
| l | Elements to load; duplicates are dropped (first wins). |
| cmp | Comparator instance (defaulted). |
| std::bad_alloc | if memory allocation fails. |
Definition at line 367 of file tpl_flat_set.H.
|
default |
Copy constructor (requires copyable Key).
|
defaultnoexcept |
Move constructor. The source is left valid but unspecified.
|
default |
|
inlinenoexcept |
Iterator to the smallest key. O(1).
Definition at line 643 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get_ptr(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by Aleph::FlatSet< Key, Compare >::cbegin(), Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::find(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::lower_bound(), Aleph::FlatSet< Key, Compare >::operator==(), TEST(), TEST(), TEST(), TEST(), and Aleph::FlatSet< Key, Compare >::upper_bound().
|
inlinenoexcept |
Return the capacity of the backing array. O(1).
Definition at line 409 of file tpl_flat_set.H.
References Aleph::MemArray< T >::capacity(), and Aleph::FlatSet< Key, Compare >::keys_.
|
inlinenoexcept |
Const iterator to the smallest key. O(1).
Definition at line 655 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin().
|
inlinenoexcept |
Const iterator past the greatest key. O(1).
Definition at line 661 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::end().
|
inlinenoexcept |
Remove all keys. Alias of empty(). Capacity is kept.
Definition at line 438 of file tpl_flat_set.H.
References Aleph::MemArray< T >::clear(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by TEST().
|
inline |
Test membership.
| k | Key to search for. |
true if an equivalent key is stored. Definition at line 461 of file tpl_flat_set.H.
References k, Aleph::FlatSet< Key, Compare >::lower_idx(), and Aleph::FlatSet< Key, Compare >::match_at().
Referenced by Aleph::FlatSet< Key, Compare >::count(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Count occurrences of a key (0 or 1).
| k | Key to search for. |
Definition at line 471 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::contains(), and k.
Referenced by TEST().
|
inlinenoexcept |
Pointer to the underlying sorted, contiguous storage. O(1).
Definition at line 667 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get_ptr(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by TEST().
|
inline |
Construct a key in place and insert it.
The key is constructed once from args and then moved into position, so this is a convenience over insert(Key(args...)), not a true in-place construction (the sorted position must be searched first).
| Args | Argument types forwarded to Key's constructor. |
| args | Arguments forwarded to Key's constructor. |
| std::bad_alloc | if a growing reallocation fails. |
Definition at line 603 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::insert().
|
inlinenoexcept |
Remove all keys (Aleph convention).
Capacity is kept.
Array::empty()), this mutates the set; use is_empty() to test for emptiness. Definition at line 432 of file tpl_flat_set.H.
References Aleph::MemArray< T >::empty(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by Aleph::FlatSet< Key, Compare >::keeping_invariants(), and TEST().
|
inlinenoexcept |
Iterator past the greatest key. O(1).
Definition at line 649 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::cend(), Aleph::FlatSet< Key, Compare >::find(), Aleph::FlatSet< Key, Compare >::operator==(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Range of elements equivalent to k.
| k | Key to bound. |
{lower_bound(k), upper_bound(k)} (length 0 or 1). Definition at line 501 of file tpl_flat_set.H.
References k, Aleph::FlatSet< Key, Compare >::lower_bound(), and Aleph::FlatSet< Key, Compare >::upper_bound().
Referenced by TEST().
|
inline |
Remove the key equivalent to k, if present.
| k | Key to remove. |
| Any | exception thrown by moving a key; the set is then left empty (see the class notes on exception safety). |
Definition at line 617 of file tpl_flat_set.H.
References k, Aleph::FlatSet< Key, Compare >::lower_idx(), Aleph::FlatSet< Key, Compare >::match_at(), and Aleph::FlatSet< Key, Compare >::remove_at().
|
inline |
Remove the key at iterator it.
| it | Valid dereferenceable iterator into this set. |
| std::out_of_range | if it does not point into the set. |
Definition at line 632 of file tpl_flat_set.H.
References ah_out_of_range_error_if, Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::remove_at(), and Aleph::FlatSet< Key, Compare >::size().
|
inline |
Find a key.
| k | Key to search for. |
end() if absent. Definition at line 450 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::end(), k, Aleph::FlatSet< Key, Compare >::lower_idx(), and Aleph::FlatSet< Key, Compare >::match_at().
|
inline |
Smallest key (checked).
| std::underflow_error | if the set is empty. |
Definition at line 530 of file tpl_flat_set.H.
References ah_underflow_error_if, Aleph::FlatSet< Key, Compare >::is_empty(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by Aleph::FlatSet< Key, Compare >::min(), and TEST().
|
inline |
Greatest key (checked).
| std::underflow_error | if the set is empty. |
Definition at line 540 of file tpl_flat_set.H.
References ah_underflow_error_if, Aleph::FlatSet< Key, Compare >::is_empty(), Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::max(), and TEST().
|
inlineprivate |
Definition at line 212 of file tpl_flat_set.H.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keeping_invariants(), Aleph::FlatSet< Key, Compare >::keys_, Aleph::FlatSet< Key, Compare >::nothrow_relocation, Aleph::MemArray< T >::putn(), Aleph::MemArray< T >::reserve(), Aleph::MemArray< T >::size(), and Aleph::MemArray< T >::swap().
Referenced by Aleph::FlatSet< Key, Compare >::insert_at(), and Aleph::FlatSet< Key, Compare >::reserve().
|
inline |
Insert a copy of k if no equivalent key exists.
| k | Key to insert. |
true if inserted / false if an equivalent key was already present). | std::bad_alloc | if a growing reallocation fails. |
Definition at line 567 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::insert_at(), k, Aleph::FlatSet< Key, Compare >::lower_idx(), and Aleph::FlatSet< Key, Compare >::match_at().
Referenced by Aleph::FlatSet< Key, Compare >::emplace(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Insert k by moving if no equivalent key exists.
| k | Key to move in. |
| std::bad_alloc | if a growing reallocation fails. |
Definition at line 582 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::insert_at(), k, Aleph::FlatSet< Key, Compare >::lower_idx(), and Aleph::FlatSet< Key, Compare >::match_at().
|
inlineprivate |
Definition at line 248 of file tpl_flat_set.H.
References Aleph::MemArray< T >::capacity(), Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::grow_to(), k, Aleph::FlatSet< Key, Compare >::keeping_invariants(), Aleph::FlatSet< Key, Compare >::keys_, Aleph::FlatSet< Key, Compare >::make_room(), and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::insert(), and Aleph::FlatSet< Key, Compare >::insert().
|
inlinenoexcept |
Return true if the set holds no keys. O(1).
Definition at line 403 of file tpl_flat_set.H.
References Aleph::MemArray< T >::is_empty(), and Aleph::FlatSet< Key, Compare >::keys_.
Referenced by Aleph::FlatSet< Key, Compare >::get_first(), Aleph::FlatSet< Key, Compare >::get_last(), TEST(), TEST(), and TEST().
|
inlineprivate |
Definition at line 191 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::empty(), and Aleph::FlatSet< Key, Compare >::nothrow_relocation.
Referenced by Aleph::FlatSet< Key, Compare >::grow_to(), Aleph::FlatSet< Key, Compare >::insert_at(), and Aleph::FlatSet< Key, Compare >::remove_at().
|
inline |
First element not less than k.
| k | Key to bound. |
e with not cmp(e, k), or end(). Definition at line 481 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin(), k, and Aleph::FlatSet< Key, Compare >::lower_idx().
Referenced by Aleph::FlatSet< Key, Compare >::equal_range(), and TEST().
|
inlineprivate |
Definition at line 149 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::cmp_, k, Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::find(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::insert(), and Aleph::FlatSet< Key, Compare >::lower_bound().
|
inlineprivate |
Definition at line 237 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keys_, Aleph::MemArray< T >::putn(), and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::insert_at().
|
inlineprivate |
Definition at line 174 of file tpl_flat_set.H.
References Aleph::and, Aleph::FlatSet< Key, Compare >::cmp_, k, Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::find(), Aleph::FlatSet< Key, Compare >::insert(), and Aleph::FlatSet< Key, Compare >::insert().
|
inline |
Greatest key (checked). Alias of get_last().
Definition at line 553 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::get_last().
Referenced by TEST().
|
inline |
Smallest key (checked). Alias of get_first().
Definition at line 547 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::get_first().
Referenced by TEST().
|
inline |
Positional access to the i-th smallest key (checked).
| i | Zero-based rank. |
| std::out_of_range | if i >= size(). |
Definition at line 512 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::keys_.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Inequality: negation of operator==.
Definition at line 705 of file tpl_flat_set.H.
|
inlinenoexcept |
Positional access without bounds checking.
| i | Zero-based rank (must be < size()). |
Definition at line 521 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::keys_.
|
default |
Copy assignment (requires copyable Key).
|
defaultnoexcept |
Move assignment. The source is left valid but unspecified.
|
inline |
Equality: same size and pairwise equal elements.
| s | Set to compare against. |
true if both sets hold equal elements in the same order. Key to be equality comparable. Definition at line 699 of file tpl_flat_set.H.
References Aleph::and, Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::end(), and Aleph::FlatSet< Key, Compare >::size().
|
inlineprivate |
Definition at line 265 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get(), Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keeping_invariants(), Aleph::FlatSet< Key, Compare >::keys_, Aleph::FlatSet< Key, Compare >::nothrow_relocation, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::erase(), and Aleph::FlatSet< Key, Compare >::erase().
|
inline |
Reserve capacity for at least cap keys.
| cap | Desired capacity (rounded up to a power of two). |
| std::bad_alloc | if memory allocation fails; the set keeps its keys. |
| std::overflow_error | if cap cannot be rounded up to a power of two; the set keeps its keys. |
| Any | exception thrown by moving a key; the set is then left empty (see the class notes on exception safety). |
Definition at line 423 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::grow_to().
|
inlinenoexcept |
Return the number of stored keys. O(1).
Definition at line 397 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::operator==(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlineprivate |
Definition at line 291 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::cmp_, Aleph::MemArray< T >::get(), Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keys_, m, Aleph::MemArray< T >::size(), and Aleph::timsort().
Referenced by Aleph::FlatSet< Key, Compare >::FlatSet().
|
inlinenoexcept |
Swap contents with s in O(1).
| s | Set to swap with. |
Definition at line 388 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::cmp_, Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::swap().
Referenced by TEST().
|
inline |
Traverse keys in sorted order while operation returns true.
Aleph-style bounded traversal: operation receives each key (as const Key &) in ascending order; returning false stops the walk.
| Operation | Callable bool(const Key &). |
| operation | Operation to apply. |
true if all keys were visited, false if stopped early. Definition at line 682 of file tpl_flat_set.H.
References Aleph::MemArray< T >::get_ptr(), Aleph::FlatSet< Key, Compare >::keys_, m, and Aleph::MemArray< T >::size().
Referenced by TEST().
|
inline |
First element greater than k.
| k | Key to bound. |
e with cmp(k, e), or end(). Definition at line 491 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::begin(), k, and Aleph::FlatSet< Key, Compare >::upper_idx().
Referenced by Aleph::FlatSet< Key, Compare >::equal_range(), and TEST().
|
inlineprivate |
Definition at line 161 of file tpl_flat_set.H.
References Aleph::FlatSet< Key, Compare >::cmp_, k, Aleph::FlatSet< Key, Compare >::keys_, and Aleph::MemArray< T >::size().
Referenced by Aleph::FlatSet< Key, Compare >::upper_bound().
|
private |
|
private |
Definition at line 145 of file tpl_flat_set.H.
Referenced by Aleph::FlatSet< Key, Compare >::FlatSet(), Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::capacity(), Aleph::FlatSet< Key, Compare >::clear(), Aleph::FlatSet< Key, Compare >::data(), Aleph::FlatSet< Key, Compare >::empty(), Aleph::FlatSet< Key, Compare >::end(), Aleph::FlatSet< Key, Compare >::get_first(), Aleph::FlatSet< Key, Compare >::get_last(), Aleph::FlatSet< Key, Compare >::grow_to(), Aleph::FlatSet< Key, Compare >::insert_at(), Aleph::FlatSet< Key, Compare >::is_empty(), Aleph::FlatSet< Key, Compare >::lower_idx(), Aleph::FlatSet< Key, Compare >::make_room(), Aleph::FlatSet< Key, Compare >::match_at(), Aleph::FlatSet< Key, Compare >::nth(), Aleph::FlatSet< Key, Compare >::operator()(), Aleph::FlatSet< Key, Compare >::remove_at(), Aleph::FlatSet< Key, Compare >::size(), Aleph::FlatSet< Key, Compare >::sort_and_unique(), Aleph::FlatSet< Key, Compare >::swap(), Aleph::FlatSet< Key, Compare >::traverse(), and Aleph::FlatSet< Key, Compare >::upper_idx().
|
staticconstexprprivate |
Definition at line 182 of file tpl_flat_set.H.
Referenced by Aleph::FlatSet< Key, Compare >::grow_to(), Aleph::FlatSet< Key, Compare >::keeping_invariants(), and Aleph::FlatSet< Key, Compare >::remove_at().