|
|
using | underlying_type = std::vector< T, Allocator > |
| | Underlying contiguous container type.
|
| |
|
using | value_type = typename underlying_type::value_type |
| | Stored element type.
|
| |
|
using | allocator_type = typename underlying_type::allocator_type |
| | Allocator type used to manage storage.
|
| |
|
using | size_type = typename underlying_type::size_type |
| | Unsigned type used for sizes and indices.
|
| |
|
using | difference_type = typename underlying_type::difference_type |
| | Signed type used for iterator distances.
|
| |
|
using | reference = typename underlying_type::reference |
| | Mutable element reference type.
|
| |
|
using | const_reference = typename underlying_type::const_reference |
| | Immutable element reference type.
|
| |
|
using | pointer = typename underlying_type::pointer |
| | Mutable element pointer type.
|
| |
|
using | const_pointer = typename underlying_type::const_pointer |
| | Immutable element pointer type.
|
| |
|
using | iterator = typename underlying_type::iterator |
| | Mutable random-access iterator type.
|
| |
|
using | const_iterator = typename underlying_type::const_iterator |
| | Immutable random-access iterator type.
|
| |
|
using | reverse_iterator = typename underlying_type::reverse_iterator |
| | Mutable reverse-iterator type.
|
| |
|
using | const_reverse_iterator = typename underlying_type::const_reverse_iterator |
| | Immutable reverse-iterator type.
|
| |
|
|
| dynar ()=default |
| | Constructs an empty dynar.
|
| |
| | dynar (Allocator const &alloc) |
| | Constructs an empty dynar with an allocator.
|
| |
| | dynar (size_type count, Allocator const &alloc=Allocator()) |
| | Constructs a dynar containing count default-inserted elements.
|
| |
| | dynar (size_type count, T const &value, Allocator const &alloc=Allocator()) |
| | Constructs a dynar containing count copies of value.
|
| |
| template<typename InputIt> |
| | dynar (InputIt first, InputIt last, Allocator const &alloc=Allocator()) |
| | Constructs a dynar from an iterator range.
|
| |
|
| dynar (dynar const &)=default |
| | Copy-constructs a dynar.
|
| |
|
| dynar (dynar &&) noexcept(std::is_nothrow_move_constructible_v< underlying_type >)=default |
| | Move-constructs a dynar.
|
| |
| | dynar (dynar const &other, Allocator const &alloc) |
| | Copy-constructs a dynar using the specified allocator.
|
| |
| | dynar (dynar &&other, Allocator const &alloc) |
| | Move-constructs a dynar using the specified allocator.
|
| |
| | dynar (std::initializer_list< T > init, Allocator const &alloc=Allocator()) |
| | Constructs a dynar from an initializer list.
|
| |
| dynar & | operator= (dynar const &)=default |
| | Copy-assigns another dynar.
|
| |
| dynar & | operator= (dynar &&) noexcept(std::is_nothrow_move_assignable_v< underlying_type >)=default |
| | Move-assigns another dynar.
|
| |
| dynar & | operator= (std::initializer_list< T > init) |
| | Replaces the contents with an initializer list.
|
| |
| void | assign (size_type count, T const &value) |
| | Assigns count copies of value.
|
| |
| template<typename InputIt> |
| void | assign (InputIt first, InputIt last) |
| | Assigns an iterator range.
|
| |
| void | assign (std::initializer_list< T > init) |
| | Assigns an initializer list.
|
| |
| allocator_type | get_allocator () const noexcept |
| | Returns a copy of the allocator associated with the container.
|
| |
| reference | at (size_type pos) |
| | Returns the element at an index with bounds checking.
|
| |
| const_reference | at (size_type pos) const |
| | Returns the element at an index with bounds checking.
|
| |
| reference | operator[] (size_type pos) |
| | Returns the element at an index without bounds checking.
|
| |
| const_reference | operator[] (size_type pos) const |
| | Returns the element at an index without bounds checking.
|
| |
| reference | front () |
| | Returns the first element.
|
| |
| const_reference | front () const |
| | Returns the first element.
|
| |
| reference | back () |
| | Returns the last element.
|
| |
| const_reference | back () const |
| | Returns the last element.
|
| |
| T * | data () noexcept |
| | Returns a pointer to the contiguous element storage.
|
| |
| T const * | data () const noexcept |
| | Returns a pointer to the contiguous element storage.
|
| |
| iterator | begin () noexcept |
| | Returns an iterator to the first element.
|
| |
| const_iterator | begin () const noexcept |
| | Returns an immutable iterator to the first element.
|
| |
| const_iterator | cbegin () const noexcept |
| | Returns an immutable iterator to the first element.
|
| |
| iterator | end () noexcept |
| | Returns an iterator one past the last element.
|
| |
| const_iterator | end () const noexcept |
| | Returns an immutable iterator one past the last element.
|
| |
| const_iterator | cend () const noexcept |
| | Returns an immutable iterator one past the last element.
|
| |
| reverse_iterator | rbegin () noexcept |
| | Returns a reverse iterator to the last element.
|
| |
| const_reverse_iterator | rbegin () const noexcept |
| | Returns an immutable reverse iterator to the last element.
|
| |
| const_reverse_iterator | crbegin () const noexcept |
| | Returns an immutable reverse iterator to the last element.
|
| |
| reverse_iterator | rend () noexcept |
| | Returns a reverse iterator preceding the first element.
|
| |
| const_reverse_iterator | rend () const noexcept |
| | Returns an immutable reverse iterator preceding the first element.
|
| |
| const_reverse_iterator | crend () const noexcept |
| | Returns an immutable reverse iterator preceding the first element.
|
| |
| bool | empty () const noexcept |
| | Returns whether the container has no elements.
|
| |
| size_type | size () const noexcept |
| | Returns the number of stored elements.
|
| |
| size_type | max_size () const noexcept |
| | Returns the maximum number of elements supported by the implementation.
|
| |
| void | reserve (size_type new_cap) |
| | Ensures storage is available for at least a requested number of elements.
|
| |
| size_type | capacity () const noexcept |
| | Returns the number of elements that fit without reallocating.
|
| |
| void | shrink_to_fit () |
| | Requests that unused capacity be released.
|
| |
|
void | clear () noexcept |
| | Removes all elements without reducing capacity.
|
| |
| iterator | insert (const_iterator pos, T const &value) |
| | Inserts a copy of an element before a position.
|
| |
| iterator | insert (const_iterator pos, T &&value) |
| | Inserts an element by moving it before a position.
|
| |
| iterator | insert (const_iterator pos, size_type count, T const &value) |
| | Inserts repeated copies of an element before a position.
|
| |
| template<typename InputIt> |
| iterator | insert (const_iterator pos, InputIt first, InputIt last) |
| | Inserts an iterator range before a position.
|
| |
| iterator | insert (const_iterator pos, std::initializer_list< T > init) |
| | Inserts an initializer list before a position.
|
| |
| template<typename... Args> |
| iterator | emplace (const_iterator pos, Args &&... args) |
| | Constructs an element in place before a position.
|
| |
| iterator | erase (const_iterator pos) |
| | Erases the element at a position.
|
| |
| iterator | erase (const_iterator first, const_iterator last) |
| | Erases an iterator range.
|
| |
| void | push_back (T const &value) |
| | Appends a copy of an element.
|
| |
| void | push_back (T &&value) |
| | Appends an element by moving it.
|
| |
| template<typename... Args> |
| reference | emplace_back (Args &&... args) |
| | Constructs an element at the end of the container.
|
| |
| void | pop_back () |
| | Removes the last element.
|
| |
| void | resize (size_type count) |
| | Changes the number of elements, value-initializing new elements.
|
| |
| void | resize (size_type count, T const &value) |
| | Changes the number of elements, copying a value for new elements.
|
| |
| void | swap (dynar &other) noexcept(noexcept(m_vector.swap(other.m_vector))) |
| | Exchanges contents with another dynar.
|
| |
template<typename T, typename Allocator = std::allocator< T >>
class rpnx::dynar< T, Allocator >
Dynamic array container with size-first ordering.
rpnx::dynar is currently implemented as a wrapper around std::vector and exposes the usual vector member operations. Its relational comparisons differ from std::vector: a dynar with fewer elements compares less than a dynar with more elements, regardless of the stored values. Dynars with equal sizes compare through the underlying std::vector.
- Template Parameters
-
| T | Stored value type. |
| Allocator | Allocator used by the underlying std::vector. |