![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
A reference class to an inline_vector object, with size-erased type. More...
Public Types | |
| using | const_iterator = typename inline_vector_detail::vector_base<T>::const_iterator |
| The const iterator type of the underlying vector. | |
| using | iterator = typename inline_vector_detail::vector_base<T>::iterator |
| The iterator type of the underlying vector. | |
| using | size_type = std::size_t |
| The size type. | |
| using | value_type = T |
| The value type. | |
Public Member Functions | |
| constexpr | vector_reference (external_vector< T > &vec) |
| Construct a vector reference to the supplied external_vector. | |
| template<std::size_t Capacity> | |
| constexpr | vector_reference (inline_vector< T, Capacity > &vec) |
| Construct a vector reference to the supplied inline_vector. | |
| template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr> | |
| constexpr auto | at (size_type index) const -> T & |
Obtain a const reference to the element with the specified index. | |
| constexpr auto | back () const noexcept -> T & |
| Get a const reference to the last element. | |
| constexpr auto | begin () const noexcept -> iterator |
| Obtain a const iterator to the start of the vector. | |
| constexpr auto | capacity () const noexcept -> size_type |
| Get the capacity. | |
| constexpr auto | cbegin () const noexcept -> const_iterator |
| Obtain an const iterator to the start of the vector. | |
| constexpr auto | cend () const noexcept -> const_iterator |
| Obtain a const iterator to the end of the vector. | |
| constexpr void | clear () const noexcept |
| Destroy all elements and set the size to zero. | |
| constexpr auto | const_operations_ptr (vector_reference_detail::ivref_passkey) const noexcept -> vector_reference_detail::const_operations< T > const * |
| Get a pointer to the struct holding const operation implementations. | |
| constexpr auto | data () const noexcept -> T * |
| Obtain a pointer to the stored elements. | |
| constexpr auto | empty () const noexcept -> bool |
| Check if the vector is empty. | |
| constexpr auto | end () const noexcept -> iterator |
| Obtain a const iterator to the end of the vector. | |
| constexpr auto | erase (const_iterator first, const_iterator last) const noexcept -> iterator |
| Erase all the element in the specified range. | |
| constexpr auto | erase (const_iterator iter) const noexcept -> iterator |
| Erase the element at the specified position. | |
| constexpr auto | front () const noexcept -> T & |
| Get a const reference to the first element. | |
| constexpr auto | get_vector_ptr (vector_reference_detail::ivref_passkey) const noexcept -> inline_vector_detail::vector_base< T > * |
| Get a pointer to the underlying vector object. | |
| template<typename InputIterator> | |
| constexpr auto | insert (const_iterator pos, InputIterator first, InputIterator last) const -> iterator |
| Insert a range of elements at the specified position. | |
| constexpr auto | insert (const_iterator pos, T const &value) const noexcept -> iterator |
| Insert a new element at the specified position in the vector by copy-constructing or copy-assigning from the supplied value. Any existing elements from the specified position to the end of the vector are moved to make room. | |
| constexpr auto | max_size () const noexcept -> size_type |
| Check if the vector is empty. | |
| constexpr auto | operator[] (size_type index) const noexcept -> T & |
| Obtain a const reference to the element with the specified index. | |
| constexpr void | pop_back () const noexcept |
| Destroy the last element in the vector and decrease the size. | |
| constexpr void | push_back (T const &element) const noexcept |
| Add a new element to the end of the vector as a copy of the supplied value. | |
| constexpr void | resize (size_type count) const |
| Resize the vector to the specified size. Default-constructs any missing elements, and destroys any excess. | |
| constexpr auto | size () const noexcept -> size_type |
| Get the current number of live elements in the vector. | |
A reference class to an inline_vector object, with size-erased type.
| T | The type of each element |
| using arene::base::vector_reference< T >::const_iterator = typename inline_vector_detail::vector_base<T>::const_iterator |
The const iterator type of the underlying vector.
| using arene::base::vector_reference< T >::iterator = typename inline_vector_detail::vector_base<T>::iterator |
The iterator type of the underlying vector.
| using arene::base::vector_reference< T >::size_type = std::size_t |
The size type.
| using arene::base::vector_reference< T >::value_type = T |
The value type.
|
inlineexplicitconstexpr |
Construct a vector reference to the supplied inline_vector.
| Capacity | The maximum number of elements that can be stored |
| vec | The inline_vector to reference |
|
inlineexplicitconstexpr |
Construct a vector reference to the supplied external_vector.
| vec | The external_vector to reference |
|
inlineconstexpr |
Obtain a const reference to the element with the specified index.
| AreExceptionsEnabled | Used to disable this overload if exceptions are not enabled. |
| index | The index of the element |
| std::out_of_range | if the index is out of range |
|
inlineconstexprnoexcept |
Get a const reference to the last element.
|
inlineconstexprnoexcept |
Obtain a const iterator to the start of the vector.
|
inlineconstexprnoexcept |
Get the capacity.
|
inlineconstexprnoexcept |
Obtain an const iterator to the start of the vector.
|
inlineconstexprnoexcept |
Obtain a const iterator to the end of the vector.
|
inlineconstexprnoexcept |
Destroy all elements and set the size to zero.
|
inlineconstexprnoexcept |
Get a pointer to the struct holding const operation implementations.
|
inlineconstexprnoexcept |
Obtain a pointer to the stored elements.
|
inlineconstexprnoexcept |
Check if the vector is empty.
true if the vector is empty, false otherwise
|
inlineconstexprnoexcept |
Obtain a const iterator to the end of the vector.
|
inlineconstexprnoexcept |
Erase all the element in the specified range.
| first | An iterator referring to the start of the range to erase |
| last | An iterator referring to the end of the range to erase |
end() if there is no such element [first,last) Must be a valid iterator range in this
|
inlineconstexprnoexcept |
Erase the element at the specified position.
| iter | An iterator referring to the element to erase |
end() if there is no such element pos Must be a valid iterator to a live element in this
|
inlineconstexprnoexcept |
Get a const reference to the first element.
|
inlineconstexprnoexcept |
Get a pointer to the underlying vector object.
|
inlineconstexpr |
Insert a range of elements at the specified position.
| pos | An iterator referring to the location to insert the elemnets |
| first | An iterator referring to the start of the range to insert |
| last | An iterator referring to the end of the range to insert |
pos otherwise pos Must be a valid iterator to this
|
inlineconstexprnoexcept |
Insert a new element at the specified position in the vector by copy-constructing or copy-assigning from the supplied value. Any existing elements from the specified position to the end of the vector are moved to make room.
| pos | The position to insert the new element |
| value | The value to copy from |
size()<Capacity, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Check if the vector is empty.
true if the vector is empty, false otherwise
|
inlineconstexprnoexcept |
Obtain a const reference to the element with the specified index.
| index | The index of the element |
index must be less than size()
|
inlineconstexprnoexcept |
Destroy the last element in the vector and decrease the size.
|
inlineconstexprnoexcept |
Add a new element to the end of the vector as a copy of the supplied value.
| element | The value to copy |
size()<Capacity, else ARENE_PRECONDITION violation
|
inlineconstexpr |
Resize the vector to the specified size. Default-constructs any missing elements, and destroys any excess.
| count | The desired size |
count<=Capacity, else ARENE_PRECONDITION violation
|
inlineconstexprnoexcept |
Get the current number of live elements in the vector.