|
RADLib
RADical C++ application framework
|
Contiguous dynamic array optimized for RADLib hot paths. More...
#include <RADDataStructures.h>
Public Types | |
| using | value_type = T |
| Stored value type. More... | |
| using | allocator_type = Alloc |
| Allocator type. More... | |
| using | size_type = size_t |
| Unsigned size type. More... | |
| using | reference = T & |
| Mutable reference type. More... | |
| using | const_reference = const T & |
| Const reference type. More... | |
| using | pointer = T * |
| Mutable pointer type. More... | |
| using | const_pointer = const T * |
| Const pointer type. More... | |
| using | iterator = T * |
| Mutable contiguous iterator. More... | |
| using | const_iterator = const T * |
| Const contiguous iterator. More... | |
Public Member Functions | |
| RADVector ()=default | |
| Creates an empty vector. More... | |
| RADVector (size_t count, const T &value=T()) | |
| Creates count copies of value. More... | |
| RADVector (std::initializer_list< T > values) | |
| Creates a vector from initializer-list values. More... | |
| RADVector (const RADVector &other) | |
| Copies another vector. More... | |
| RADVector (RADVector &&other) noexcept | |
| Moves another vector without moving individual elements when possible. More... | |
| RADVector & | operator= (const RADVector &other) |
| Replaces this vector with a copy of other. More... | |
| RADVector & | operator= (RADVector &&other) noexcept |
| Replaces this vector by taking other's storage. More... | |
| ~RADVector () | |
| Destroys all elements and releases owned storage. More... | |
| iterator | begin () noexcept |
| Returns iterator to first element. More... | |
| const_iterator | begin () const noexcept |
| Returns const iterator to first element. More... | |
| const_iterator | cbegin () const noexcept |
| Returns const iterator to first element. More... | |
| iterator | end () noexcept |
| Returns iterator one past the last element. More... | |
| const_iterator | end () const noexcept |
| Returns const iterator one past the last element. More... | |
| const_iterator | cend () const noexcept |
| Returns const iterator one past the last element. More... | |
| bool | empty () const noexcept |
| Returns true when the vector contains no elements. More... | |
| size_t | size () const noexcept |
| Returns the number of constructed elements. More... | |
| size_t | capacity () const noexcept |
| Returns allocated element capacity. More... | |
| T * | data () noexcept |
| Returns mutable contiguous storage pointer. More... | |
| const T * | data () const noexcept |
| Returns const contiguous storage pointer. More... | |
| T & | operator[] (size_t index) noexcept |
| Returns element at index without bounds checking. More... | |
| const T & | operator[] (size_t index) const noexcept |
| Returns const element at index without bounds checking. More... | |
| T & | at (size_t index) |
| Returns element at index or throws std::out_of_range. More... | |
| const T & | at (size_t index) const |
| Returns const element at index or throws std::out_of_range. More... | |
| T & | front () noexcept |
| Returns first element; vector must not be empty. More... | |
| const T & | front () const noexcept |
| Returns first element; vector must not be empty. More... | |
| T & | back () noexcept |
| Returns last element; vector must not be empty. More... | |
| const T & | back () const noexcept |
| Returns last element; vector must not be empty. More... | |
| void | reserve (size_t newCapacity) |
| Ensures capacity is at least newCapacity. More... | |
| void | shrink_to_fit () |
| Releases unused capacity when possible. More... | |
| void | resize (size_t newSize) |
| Resizes with value-initialized new elements. More... | |
| void | resize (size_t newSize, const T &value) |
| Resizes with copies of value for new elements. More... | |
| template<typename... Args> | |
| T & | emplace_back (Args &&... args) |
| Constructs an element at the end and returns it. More... | |
| void | push_back (const T &value) |
| Appends a copy of value. More... | |
| void | push_back (T &&value) |
| Appends value by move. More... | |
| void | pop_back () |
| Removes the last element when present. More... | |
| iterator | erase (const_iterator position) |
| Removes the element at position and returns the next iterator. More... | |
| void | clear () noexcept |
| Destroys all elements while keeping capacity. More... | |
Contiguous dynamic array optimized for RADLib hot paths.
| using RADData::RADVector< T, Alloc >::allocator_type = Alloc |
Allocator type.
| using RADData::RADVector< T, Alloc >::const_iterator = const T* |
Const contiguous iterator.
| using RADData::RADVector< T, Alloc >::const_pointer = const T* |
Const pointer type.
| using RADData::RADVector< T, Alloc >::const_reference = const T& |
Const reference type.
| using RADData::RADVector< T, Alloc >::iterator = T* |
Mutable contiguous iterator.
| using RADData::RADVector< T, Alloc >::pointer = T* |
Mutable pointer type.
| using RADData::RADVector< T, Alloc >::reference = T& |
Mutable reference type.
| using RADData::RADVector< T, Alloc >::size_type = size_t |
Unsigned size type.
| using RADData::RADVector< T, Alloc >::value_type = T |
Stored value type.
|
default |
Creates an empty vector.
|
inlineexplicit |
Creates count copies of value.
|
inline |
Creates a vector from initializer-list values.
|
inline |
Copies another vector.
|
inlinenoexcept |
Moves another vector without moving individual elements when possible.
|
inline |
Destroys all elements and releases owned storage.
|
inline |
Returns element at index or throws std::out_of_range.
|
inline |
Returns const element at index or throws std::out_of_range.
|
inlinenoexcept |
Returns last element; vector must not be empty.
|
inlinenoexcept |
Returns last element; vector must not be empty.
|
inlinenoexcept |
Returns const iterator to first element.
|
inlinenoexcept |
Returns iterator to first element.
|
inlinenoexcept |
Returns allocated element capacity.
|
inlinenoexcept |
Returns const iterator to first element.
|
inlinenoexcept |
Returns const iterator one past the last element.
|
inlinenoexcept |
Destroys all elements while keeping capacity.
|
inlinenoexcept |
Returns const contiguous storage pointer.
|
inlinenoexcept |
Returns mutable contiguous storage pointer.
|
inline |
Constructs an element at the end and returns it.
|
inlinenoexcept |
Returns true when the vector contains no elements.
|
inlinenoexcept |
Returns const iterator one past the last element.
|
inlinenoexcept |
Returns iterator one past the last element.
|
inline |
Removes the element at position and returns the next iterator.
|
inlinenoexcept |
Returns first element; vector must not be empty.
|
inlinenoexcept |
Returns first element; vector must not be empty.
|
inline |
Replaces this vector with a copy of other.
|
inlinenoexcept |
Replaces this vector by taking other's storage.
|
inlinenoexcept |
Returns const element at index without bounds checking.
|
inlinenoexcept |
Returns element at index without bounds checking.
|
inline |
Removes the last element when present.
|
inline |
Appends a copy of value.
|
inline |
Appends value by move.
|
inline |
Ensures capacity is at least newCapacity.
|
inline |
Resizes with value-initialized new elements.
|
inline |
Resizes with copies of value for new elements.
|
inline |
Releases unused capacity when possible.
|
inlinenoexcept |
Returns the number of constructed elements.