|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Contiguous dynamic array with N elements of inline storage.
More...
#include <tpl_small_vector.H>
Public Types | |
| using | Item_Type = T |
| Aleph convention: element type. | |
| using | value_type = T |
| STL convention: value type. | |
| using | size_type = size_t |
| STL convention: size type. | |
| using | iterator = T * |
| Random-access iterator. | |
| using | const_iterator = const T * |
| Random-access const iterator. | |
Public Member Functions | |
| SmallVector () noexcept | |
| Construct an empty vector using the inline storage. Never allocates. | |
| SmallVector (const size_t n, const T &value) | |
Construct with n copies of value. | |
| SmallVector (std::initializer_list< T > l) | |
| Construct from an initializer list. | |
| template<std::input_iterator It> | |
| SmallVector (It first, It last) | |
| Construct from an iterator range. | |
| SmallVector (const SmallVector &v) | |
Copy constructor (requires copyable T). | |
| SmallVector (SmallVector &&v) noexcept(std::is_nothrow_move_constructible_v< T >) | |
| Move constructor. | |
| SmallVector & | operator= (const SmallVector &v) |
Copy assignment (requires copyable T). | |
| SmallVector & | operator= (SmallVector &&v) noexcept(std::is_nothrow_move_constructible_v< T >) |
| Move assignment. The source is left empty. | |
| ~SmallVector () | |
| void | swap (SmallVector &v) noexcept(std::is_nothrow_move_constructible_v< T >) |
Swap contents with v. | |
| size_t | size () const noexcept |
| Return the number of stored elements. O(1). | |
| size_t | capacity () const noexcept |
| Return the current capacity (inline or heap). O(1). | |
| bool | is_empty () const noexcept |
Return true if no elements are stored. O(1). | |
| bool | is_small () const noexcept |
Return true while the elements still live in the inline buffer. O(1). | |
| void | reserve (const size_t cap) |
Reserve capacity for at least cap elements. | |
| void | empty () noexcept |
| Destroy all elements (Aleph convention). | |
| void | clear () noexcept |
Destroy all elements. Alias of empty(). Capacity is kept. | |
| T & | operator[] (size_t i) |
| Checked access to the i-th element. | |
| const T & | operator[] (size_t i) const |
Checked const access to the i-th element (throws std::out_of_range). | |
| T & | operator() (size_t i) noexcept |
Unchecked access to the i-th element (must be < size()). | |
| const T & | operator() (size_t i) const noexcept |
Unchecked const access to the i-th element (must be < size()). | |
| T & | get_first () |
| First element (checked). | |
| const T & | get_first () const |
| T & | get_last () |
| Last element (checked). | |
| const T & | get_last () const |
| T * | data () noexcept |
| Pointer to the contiguous element storage. O(1). | |
| const T * | data () const noexcept |
| template<class... Args> | |
| T & | emplace_back (Args &&...args) |
| Construct an element in place at the end. | |
| T & | append (const T &item) |
Append a copy of item. | |
| T & | append (T &&item) |
Append item by moving. | |
| void | append_range (const T *first, const size_t count) |
Append count copies from [first, first + count), in order. | |
| T & | push_back (const T &item) |
STL-style alias of append(const T &). | |
| T & | push_back (T &&item) |
STL-style alias of append(T &&). | |
| T | remove_last () |
| Remove and return the last element. | |
| void | pop_back () |
| Remove the last element (STL style). | |
| T & | insert (size_t pos, T item) |
Insert an element at position pos, shifting the tail right. | |
| void | erase (const size_t pos) |
Remove the element at position pos, shifting the tail left. | |
| iterator | begin () noexcept |
| Iterator to the first element. O(1). | |
| iterator | end () noexcept |
| Iterator past the last element. O(1). | |
| const_iterator | begin () const noexcept |
| Const iterator to the first element. O(1). | |
| const_iterator | end () const noexcept |
| Const iterator past the last element. O(1). | |
| const_iterator | cbegin () const noexcept |
| Const iterator to the first element. O(1). | |
| const_iterator | cend () const noexcept |
| Const iterator past the last element. O(1). | |
| template<class Operation > | |
| bool | traverse (Operation operation) |
Traverse elements in order while operation returns true. | |
| template<class Operation > | |
| bool | traverse (Operation operation) const |
Const traversal in order while operation returns true. | |
| template<size_t M> | |
| bool | operator== (const SmallVector< T, M > &v) const |
| Equality: same size and pairwise equal elements. | |
| template<size_t M> | |
| bool | operator!= (const SmallVector< T, M > &v) const |
Inequality: negation of operator==. | |
Private Member Functions | |
| T * | inline_ptr () noexcept |
| const T * | inline_ptr () const noexcept |
| void | relocate (const size_t new_cap) |
| void | grow (const size_t min_cap) |
| void | steal (SmallVector &&o) noexcept(std::is_nothrow_move_constructible_v< T >) |
| void | release () noexcept |
Static Private Member Functions | |
| static T * | allocate (size_t m) |
| static void | deallocate (T *p, size_t m) noexcept |
Private Attributes | |
| std::byte | storage_ [N *sizeof(T)] |
| T * | ptr_ |
| size_t | n_ = 0 |
| size_t | cap_ = N |
Contiguous dynamic array with N elements of inline storage.
Elements live inside the object until the size exceeds N, at which point the contents move to a heap buffer that grows geometrically (factor 2). The container never returns to inline storage once spilled (even if it shrinks below N), so pointers into a heap-mode vector are only invalidated by growth.
| T | Element type. Must be move-constructible. Copy operations additionally require copy-constructible/assignable T. |
| N | Number of inline slots (must be positive). Choose it from the common-case size of the data, not the worst case. |
T * / const T *): contiguous, random access. Growth reallocates and invalidates all iterators and references.Array), empty() clears the container and is_empty() is the emptiness predicate. Both append and push_back names are provided.T has a non-throwing move constructor or is copyable (std::move_if_noexcept semantics).Definition at line 117 of file tpl_small_vector.H.
Random-access const iterator.
Definition at line 240 of file tpl_small_vector.H.
Aleph convention: element type.
Definition at line 236 of file tpl_small_vector.H.
Random-access iterator.
Definition at line 239 of file tpl_small_vector.H.
STL convention: size type.
Definition at line 238 of file tpl_small_vector.H.
STL convention: value type.
Definition at line 237 of file tpl_small_vector.H.
|
inlinenoexcept |
Construct an empty vector using the inline storage. Never allocates.
Definition at line 243 of file tpl_small_vector.H.
Construct with n copies of value.
| n | Number of elements. |
| value | Value copied into each element. |
| std::bad_alloc | if n > N and the heap buffer cannot be allocated. |
Definition at line 251 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, Aleph::SmallVector< T, N >::release(), and value.
|
inline |
Construct from an initializer list.
| l | Elements to copy, in order. |
| std::bad_alloc | if the heap buffer cannot be allocated. |
Definition at line 273 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), l, Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, Aleph::SmallVector< T, N >::release(), and Aleph::HTList::size().
|
inline |
Construct from an iterator range.
| It | Input iterator whose value type converts to T. |
| first | Beginning of the range. |
| last | End of the range. |
| std::bad_alloc | if the heap buffer cannot be allocated. |
Definition at line 301 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::append(), and Aleph::SmallVector< T, N >::release().
|
inline |
Copy constructor (requires copyable T).
Definition at line 316 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, and Aleph::SmallVector< T, N >::release().
|
inlinenoexcept |
Move constructor.
Heap-mode sources are stolen in O(1); inline-mode sources are moved element by element (O(n)). The source is left empty.
Definition at line 339 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::steal().
|
inline |
Definition at line 369 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::release().
|
inlinestaticprivate |
Definition at line 140 of file tpl_small_vector.H.
References m.
Referenced by Aleph::SmallVector< T, N >::relocate().
Append a copy of item.
| item | Element to copy. |
| std::bad_alloc | if a growing reallocation fails. |
Definition at line 555 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::emplace_back().
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::push_back(), Aleph::SmallVector< T, N >::push_back(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Append item by moving.
| item | Element to move in. |
| std::bad_alloc | if a growing reallocation fails. |
Definition at line 567 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::emplace_back().
Append count copies from [first, first + count), in order.
| first | Pointer to the first source element. May be nullptr only when count == 0 (nothing is read from it then). |
| count | Number of elements to copy. |
[first, first + count) is a valid range of live T objects (readable, not past-the-end of their own storage). [first, first + count) does not overlap this vector's own element storage (i.e. first is not itself data() or a pointer derived from it), including across a reallocation this very call might trigger: if count grows the vector past capacity(), grow() relocates to a new buffer and frees the old one before any copying happens, so a first that pointed into the old buffer would already be dangling by the time it is read. Like std::memcpy, this does not support appending a vector's own elements to itself. | std::invalid_argument | if first == nullptr and count > 0. |
| std::bad_alloc | if a growing reallocation fails. |
| std::overflow_error | if count would overflow size_t when added to the current size(), or if growing the capacity to fit the result would overflow (see grow()'s own capacity-doubling guard). |
append(first[i]) for i in [0, count), in order, but faster: when T is trivially copyable, the whole range is copied with a single std::uninitialized_copy_n call instead of count individual placement-new calls (safe because a trivially copyable type's copy can never throw and has no observable side effects beyond the bytes themselves; standard library implementations lower this to a single memcpy for such types). For any other copy-constructible T, this still grows at most once for the whole range (rather than up to count times) before placement-constructing each element, with the same strong exception guarantee as append: if a mid-range copy throws, only the newly-appended elements are unwound and size() is left exactly as it was before the call. O(count), or O(size() + count) on the occasions this triggers a growing reallocation. @par Thread Safety), concurrent calls on the same instance require external synchronization. Definition at line 613 of file tpl_small_vector.H.
References ah_invalid_argument_if, ah_overflow_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::count(), Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::Rope< Char, LeafSize >::build_from_view(), Aleph::Rope< Char, LeafSize >::slice(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Rope< Char, LeafSize >::try_absorb_left(), and Aleph::Rope< Char, LeafSize >::try_absorb_right().
|
inlinenoexcept |
Const iterator to the first element. O(1).
Definition at line 754 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
Iterator to the first element. O(1).
Definition at line 742 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inlinenoexcept |
Return the current capacity (inline or heap). O(1).
Definition at line 404 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::cap_.
|
inlinenoexcept |
Const iterator to the first element. O(1).
Definition at line 766 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
|
inlinenoexcept |
Const iterator past the last element. O(1).
Definition at line 772 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Destroy all elements. Alias of empty(). Capacity is kept.
Definition at line 442 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::empty().
Referenced by TEST().
|
inlinenoexcept |
Definition at line 520 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
|
inlinenoexcept |
Pointer to the contiguous element storage. O(1).
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 514 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
Definition at line 145 of file tpl_small_vector.H.
References m.
Referenced by Aleph::SmallVector< T, N >::release(), and Aleph::SmallVector< T, N >::relocate().
|
inline |
Construct an element in place at the end.
| Args | Argument types forwarded to T's constructor. |
| args | Arguments forwarded to T's constructor. |
| std::bad_alloc | if a growing reallocation fails. |
args reference elements of this vector (the element is built before any reallocation). Definition at line 536 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::SmallVector< T, N >::append(), Aleph::SmallVector< T, N >::append(), TEST(), and TEST().
Destroy all elements (Aleph convention).
Capacity is kept.
Array::empty()), this mutates the vector; use is_empty() to test emptiness. Definition at line 435 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::SmallVector< T, N >::clear(), and TEST().
|
inlinenoexcept |
Const iterator past the last element. O(1).
Definition at line 760 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Iterator past the last element. O(1).
Definition at line 748 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inline |
Remove the element at position pos, shifting the tail left.
| pos | Position of the element to remove, in [0, size()). |
| std::out_of_range | if pos >= size(). |
Definition at line 730 of file tpl_small_vector.H.
References ah_out_of_range_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inline |
First element (checked).
| std::underflow_error | if the vector is empty. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 483 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
|
inline |
Definition at line 490 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
|
inline |
Last element (checked).
| std::underflow_error | if the vector is empty. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 500 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Definition at line 507 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
|
inlineprivate |
Definition at line 175 of file tpl_small_vector.H.
References ah_overflow_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, and Aleph::SmallVector< T, N >::relocate().
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::emplace_back(), Aleph::SmallVector< T, N >::insert(), Aleph::SmallVector< T, N >::operator=(), and Aleph::SmallVector< T, N >::reserve().
|
inlineprivatenoexcept |
Definition at line 135 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::storage_.
|
inlineprivatenoexcept |
Definition at line 130 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::storage_.
Referenced by Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::release().
|
inline |
Insert an element at position pos, shifting the tail right.
| pos | Insertion position in [0, size()]. |
| item | Element to insert (taken by value: pass rvalues to move). |
| std::out_of_range | if pos > size(). |
| std::bad_alloc | if a growing reallocation fails. |
Definition at line 706 of file tpl_small_vector.H.
References ah_out_of_range_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inlinenoexcept |
Return true if no elements are stored. O(1).
Definition at line 410 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_.
|
inlinenoexcept |
Return true while the elements still live in the inline buffer. O(1).
Definition at line 416 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::inline_ptr(), and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::SmallVector< T, N >::release(), Aleph::SmallVector< T, N >::relocate(), Aleph::SmallVector< T, N >::swap(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Inequality: negation of operator==.
Definition at line 829 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching().
|
inlinenoexcept |
Unchecked const access to the i-th element (must be < size()).
Definition at line 474 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
|
inlinenoexcept |
Unchecked access to the i-th element (must be < size()).
Definition at line 468 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::ptr_.
|
inline |
Copy assignment (requires copyable T).
Definition at line 346 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, and Aleph::SmallVector< T, N >::release().
|
inlinenoexcept |
Move assignment. The source is left empty.
Definition at line 360 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::release(), and Aleph::SmallVector< T, N >::steal().
|
inline |
Equality: same size and pairwise equal elements.
| v | Vector to compare against (any inline capacity). |
true if both vectors hold equal elements in the same order. T equality comparable. Definition at line 817 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, and Aleph::SmallVector< T, N >::size().
|
inline |
Checked access to the i-th element.
| i | Zero-based index. |
| std::out_of_range | if i >= size(). |
Definition at line 454 of file tpl_small_vector.H.
References ah_out_of_range_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
|
inline |
Checked const access to the i-th element (throws std::out_of_range).
Definition at line 461 of file tpl_small_vector.H.
References ah_out_of_range_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Remove the last element (STL style).
| std::underflow_error | if the vector is empty. |
Definition at line 692 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
STL-style alias of append(const T &).
Definition at line 663 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::append().
STL-style alias of append(T &&).
Definition at line 670 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::append().
|
inlineprivatenoexcept |
Definition at line 225 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::deallocate(), Aleph::SmallVector< T, N >::inline_ptr(), Aleph::SmallVector< T, N >::is_small(), N, Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::~SmallVector(), Aleph::SmallVector< T, N >::operator=(), Aleph::SmallVector< T, N >::operator=(), and Aleph::SmallVector< T, N >::steal().
|
inlineprivate |
Definition at line 152 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::allocate(), Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::deallocate(), Aleph::SmallVector< T, N >::is_small(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by Aleph::SmallVector< T, N >::grow().
Remove and return the last element.
| std::underflow_error | if the vector is empty. |
Definition at line 680 of file tpl_small_vector.H.
References ah_underflow_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
|
inline |
Reserve capacity for at least cap elements.
| cap | Desired capacity. Values <= capacity() are no-ops. |
| std::bad_alloc | if the heap buffer cannot be allocated. |
Definition at line 425 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::cap_, and Aleph::SmallVector< T, N >::grow().
|
inlinenoexcept |
Return the number of stored elements. O(1).
Definition at line 398 of file tpl_small_vector.H.
References Aleph::SmallVector< T, N >::n_.
Referenced by Aleph::Rope< Char, LeafSize >::make_leaf(), Aleph::SmallVector< T, N >::operator==(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlineprivatenoexcept |
Definition at line 188 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, N, Aleph::SmallVector< T, N >::n_, Aleph::SmallVector< T, N >::ptr_, and Aleph::SmallVector< T, N >::release().
Referenced by Aleph::SmallVector< T, N >::SmallVector(), and Aleph::SmallVector< T, N >::operator=().
|
inlinenoexcept |
Swap contents with v.
O(1) when both vectors are in heap mode; otherwise elements are moved individually (O(n + m)).
| v | Vector to swap with. |
Definition at line 381 of file tpl_small_vector.H.
References Aleph::and, Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::cap_, Aleph::SmallVector< T, N >::is_small(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inline |
Traverse elements in order while operation returns true.
Aleph-style bounded traversal: operation receives each element in index order; returning false stops the walk.
| Operation | Callable bool(T &). |
| operation | Operation to apply. |
true if all elements were visited, false if stopped early. Definition at line 787 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Referenced by TEST().
|
inline |
Const traversal in order while operation returns true.
| Operation | Callable bool(const T &). |
| operation | Operation to apply. |
true if all elements were visited, false if stopped early. Definition at line 801 of file tpl_small_vector.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::SmallVector< T, N >::n_, and Aleph::SmallVector< T, N >::ptr_.
Definition at line 128 of file tpl_small_vector.H.
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::capacity(), Aleph::SmallVector< T, N >::emplace_back(), Aleph::SmallVector< T, N >::grow(), Aleph::SmallVector< T, N >::insert(), Aleph::SmallVector< T, N >::operator=(), Aleph::SmallVector< T, N >::release(), Aleph::SmallVector< T, N >::relocate(), Aleph::SmallVector< T, N >::reserve(), Aleph::SmallVector< T, N >::steal(), and Aleph::SmallVector< T, N >::swap().
|
private |
Definition at line 127 of file tpl_small_vector.H.
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::cend(), Aleph::SmallVector< T, N >::emplace_back(), Aleph::SmallVector< T, N >::empty(), Aleph::SmallVector< T, N >::end(), Aleph::SmallVector< T, N >::end(), Aleph::SmallVector< T, N >::erase(), Aleph::SmallVector< T, N >::get_first(), Aleph::SmallVector< T, N >::get_first(), Aleph::SmallVector< T, N >::get_last(), Aleph::SmallVector< T, N >::get_last(), Aleph::SmallVector< T, N >::insert(), Aleph::SmallVector< T, N >::is_empty(), Aleph::SmallVector< T, N >::operator=(), Aleph::SmallVector< T, N >::operator==(), Aleph::SmallVector< T, N >::operator[](), Aleph::SmallVector< T, N >::operator[](), Aleph::SmallVector< T, N >::pop_back(), Aleph::SmallVector< T, N >::release(), Aleph::SmallVector< T, N >::relocate(), Aleph::SmallVector< T, N >::remove_last(), Aleph::SmallVector< T, N >::size(), Aleph::SmallVector< T, N >::steal(), Aleph::SmallVector< T, N >::swap(), Aleph::SmallVector< T, N >::traverse(), and Aleph::SmallVector< T, N >::traverse().
Definition at line 126 of file tpl_small_vector.H.
Referenced by Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::SmallVector(), Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::begin(), Aleph::SmallVector< T, N >::begin(), Aleph::SmallVector< T, N >::cbegin(), Aleph::SmallVector< T, N >::cend(), Aleph::SmallVector< T, N >::data(), Aleph::SmallVector< T, N >::data(), Aleph::SmallVector< T, N >::emplace_back(), Aleph::SmallVector< T, N >::empty(), Aleph::SmallVector< T, N >::end(), Aleph::SmallVector< T, N >::end(), Aleph::SmallVector< T, N >::erase(), Aleph::SmallVector< T, N >::get_first(), Aleph::SmallVector< T, N >::get_first(), Aleph::SmallVector< T, N >::get_last(), Aleph::SmallVector< T, N >::get_last(), Aleph::SmallVector< T, N >::insert(), Aleph::SmallVector< T, N >::is_small(), Aleph::SmallVector< T, N >::operator()(), Aleph::SmallVector< T, N >::operator()(), Aleph::SmallVector< T, N >::operator=(), Aleph::SmallVector< T, N >::operator==(), Aleph::SmallVector< T, N >::operator[](), Aleph::SmallVector< T, N >::operator[](), Aleph::SmallVector< T, N >::pop_back(), Aleph::SmallVector< T, N >::release(), Aleph::SmallVector< T, N >::relocate(), Aleph::SmallVector< T, N >::remove_last(), Aleph::SmallVector< T, N >::steal(), Aleph::SmallVector< T, N >::swap(), Aleph::SmallVector< T, N >::traverse(), and Aleph::SmallVector< T, N >::traverse().
Definition at line 125 of file tpl_small_vector.H.
Referenced by Aleph::SmallVector< T, N >::inline_ptr(), and Aleph::SmallVector< T, N >::inline_ptr().