|
Uni20
Asynchronous tensor and runtime library.
|
A fixed-capacity vector with stack storage and std::vector-like API.
More...
#include <static_vector.hpp>
Public Types | |
| using | const_iterator = T const * |
| using | const_pointer = T const * |
| using | const_reference = T const & |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
| using | difference_type = std::ptrdiff_t |
| using | iterator = T * |
| using | pointer = T * |
| using | reference = T & |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| using | size_type = std::size_t |
| using | value_type = T |
Public Member Functions | |
| reference | at (size_type pos) |
| Bounds-checked element access. | |
| const_reference | at (size_type pos) const |
| reference | back () |
| const_reference | back () const |
| const_iterator | begin () const noexcept |
| iterator | begin () noexcept |
| const_iterator | cbegin () const noexcept |
| const_iterator | cend () const noexcept |
| void | clear () noexcept |
| Destroy all elements and reset size to zero. | |
| const_reverse_iterator | crbegin () const noexcept |
| const_reverse_iterator | crend () const noexcept |
| const_pointer | data () const noexcept |
| pointer | data () noexcept |
| template<class... Args> | |
| void | emplace_back (Args &&... args) |
| Construct a new element in-place at the end. | |
| bool | empty () const noexcept |
| const_iterator | end () const noexcept |
| iterator | end () noexcept |
| reference | front () |
| const_reference | front () const |
| static_vector & | operator= (static_vector &&o) noexcept(std::is_nothrow_move_assignable< T >::value) |
| Move assignment. | |
| static_vector & | operator= (static_vector const &o) |
| Copy assignment. | |
| static_vector & | operator= (std::initializer_list< T > init) |
| Assign from an initializer list. | |
| reference | operator[] (size_type pos) |
| const_reference | operator[] (size_type pos) const |
| void | pop_back () |
| Remove the last element. | |
| void | push_back (T &&value) |
Append a new moved value to the end. | |
| void | push_back (T const &value) |
Append a new copy of value to the end. | |
| const_reverse_iterator | rbegin () const noexcept |
| reverse_iterator | rbegin () noexcept |
| const_reverse_iterator | rend () const noexcept |
| reverse_iterator | rend () noexcept |
| void | resize (size_type count) |
Resize the vector to count elements. | |
| size_type | size () const noexcept |
| static_vector () noexcept | |
| Default-construct an empty static_vector. | |
| static_vector (size_type count) | |
Construct with count default-initialized elements. | |
| static_vector (size_type count, T const &value) | |
Construct with count copies of value. | |
| static_vector (static_vector &&o) noexcept(std::is_nothrow_move_constructible< T >::value) | |
| Move constructor. | |
| static_vector (static_vector const &o) | |
| Copy constructor. | |
| static_vector (std::initializer_list< T > init) | |
| Construct from an initializer list. | |
| void | swap (static_vector &other) noexcept(std::is_nothrow_swappable< T >::value) |
| Swap contents with another static_vector. | |
| ~static_vector () | |
| Destructor. Destroys all elements in-place. | |
Static Public Member Functions | |
| static constexpr size_type | capacity () noexcept |
| static constexpr size_type | max_size () noexcept |
A fixed-capacity vector with stack storage and std::vector-like API.
| T | Element type |
| MaxSize | Maximum number of elements (capacity, fixed at compile time) |
| using static_vector< T, MaxSize >::const_iterator = T const* |
| using static_vector< T, MaxSize >::const_pointer = T const* |
| using static_vector< T, MaxSize >::const_reference = T const& |
| using static_vector< T, MaxSize >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
| using static_vector< T, MaxSize >::difference_type = std::ptrdiff_t |
| using static_vector< T, MaxSize >::iterator = T* |
| using static_vector< T, MaxSize >::pointer = T* |
| using static_vector< T, MaxSize >::reference = T& |
| using static_vector< T, MaxSize >::reverse_iterator = std::reverse_iterator<iterator> |
| using static_vector< T, MaxSize >::size_type = std::size_t |
| using static_vector< T, MaxSize >::value_type = T |
|
inlinenoexcept |
Default-construct an empty static_vector.
|
inlineexplicit |
Construct with count default-initialized elements.
count <= MaxSize
|
inline |
Construct with count copies of value.
|
inline |
Construct from an initializer list.
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
inline |
Destructor. Destroys all elements in-place.
|
inline |
Bounds-checked element access.
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Destroy all elements and reset size to zero.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Construct a new element in-place at the end.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinestaticconstexprnoexcept |
|
inlinenoexcept |
Move assignment.
|
inline |
Copy assignment.
|
inline |
Assign from an initializer list.
|
inline |
|
inline |
|
inline |
Remove the last element.
|
inline |
Append a new moved value to the end.
|
inline |
Append a new copy of value to the end.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Resize the vector to count elements.
|
inlinenoexcept |
|
inlinenoexcept |
Swap contents with another static_vector.