template<class TypeT, class Alloc = allocator<TypeT>>
struct fennec::dynarray< TypeT, Alloc >
| Property | Value |
| stable | ⛔ |
| dynamic | ✅ |
| homogenous | ✅ |
| distinct | ⛔ |
| ordered | ⛔ |
| space | \(O(N)\) |
| linear | ✅ |
| access | \(O(1)\) |
| find | \(O(N)\) |
| insertion | \(O(N)\) |
| deletion | \(O(N)\) |
This structure prefers shallow moves and deep copies.
- Template Parameters
-
|
|
|
constexpr | dynarray () |
| | Default Constructor, initializes an empty allocation.
|
| |
| constexpr | dynarray (const alloc_t &alloc) |
| | Alloc Constructor, initialize empty allocation with allocator instance.
|
| |
| constexpr | dynarray (alloc_t &&alloc) noexcept |
| | Alloc Move Constructor, initialize empty allocation with allocator instance.
|
| |
| constexpr | dynarray (size_t n) |
| | Sized Allocation, initializes a dynarray with n elements using the default constructor.
|
| |
| constexpr | dynarray (size_t n, const alloc_t &alloc) |
| | Sized Allocation Alloc Constructor, initializes a dynarray with allocator alloc and n elements using the default constructor.
|
| |
| constexpr | dynarray (size_t n, alloc_t &&alloc) |
| | Sized Allocation Alloc Move Constructor, initializes a dynarray with allocator alloc and n elements using the default constructor.
|
| |
| constexpr | dynarray (size_t n, const TypeT &val) |
| | Sized Allocation Copy Constructor, Create an allocation of size n elements, with each element constructed using the copy constructor.
|
| |
| template<typename... ArgsT> |
| constexpr | dynarray (size_t n, ArgsT &&...args) |
| | Emplace Constructor.
|
| |
| template<size_t N> |
| constexpr | dynarray (const TypeT(&arr)[N]) |
| | Array Copy Constructor.
|
| |
| template<size_t N> |
| constexpr | dynarray (TypeT(&&arr)[N]) |
| | Array Move Constructor.
|
| |
| template<typename OTypeT , class OAlloc > |
| constexpr | dynarray (const dynarray< OTypeT, OAlloc > &conv) |
| | Conversion Constructor, copies elements of conv as this value_t
|
| |
| constexpr | dynarray (initializer_list< value_t > l, const alloc_t &alloc=alloc_t()) |
| | Initializer List Constructor.
|
| |
| constexpr | dynarray (const dynarray &arr) |
| | Copy Constructor, uses the copy constructor to copy each element.
|
| |
| constexpr | dynarray (dynarray &&arr) noexcept |
| | Move Constructor, takes ownership of the allocation.
|
| |
|
constexpr | ~dynarray () |
| | Default Destructor, destructs all elements and frees the underlying allocation.
|
| |
|
| constexpr dynarray & | operator= (const dynarray &arr) |
| | Copy Assignment Operator.
|
| |
| constexpr dynarray & | operator= (dynarray &&arr) noexcept |
| | Move Assignment Operator.
|
| |
| template<size_t N> |
| constexpr dynarray & | operator= (const TypeT(&arr)[N]) |
| | Array Copy Assignment Operator.
|
| |
| template<size_t N> |
| constexpr dynarray & | operator= (TypeT(&&arr)[N]) |
| | Array Copy Assignment Operator.
|
| |
| constexpr size_t | size () const |
| |
| constexpr size_t | capacity () const |
| |
| constexpr bool | empty () const |
| |
|
| constexpr TypeT & | operator[] (size_t i) |
| | Array Access Operator.
|
| |
| constexpr const TypeT & | operator[] (size_t i) const |
| | Array Access Operator (const)
|
| |
| constexpr TypeT & | front () |
| |
| constexpr const TypeT & | front () const |
| |
| constexpr TypeT & | back () |
| |
| constexpr const TypeT & | back () const |
| |
|
| constexpr void | insert (size_t i, TypeT &&val) |
| | Move Insertion.
|
| |
| constexpr void | insert (size_t i, const TypeT &val) |
| | Copy Insertion.
|
| |
| template<typename... ArgsT> |
| constexpr void | emplace (size_t i, ArgsT &&...args) |
| | Emplace Insertion.
|
| |
| constexpr void | push_back (const TypeT &val) |
| | Push Back Copy.
|
| |
| constexpr void | push_back (TypeT &&val) |
| | Push Back Move.
|
| |
| template<typename... ArgsT> |
| constexpr void | emplace_back (ArgsT...args) |
| | Emplace Back.
|
| |
|
constexpr void | pop_back () |
| | Erase last element.
|
| |
| constexpr void | resize (size_t n) |
| | Resize the dynarray, invoking the default constructor for all new elements.
|
| |
| constexpr void | resize (size_t n, const TypeT &val) |
| | Resize the dynarray, invoking the copy constructor for all new elements.
|
| |
|
constexpr void | clear () |
| | Clears the contents of the dynarray, destructing all elements and releasing the allocation.
|
| |
|
| constexpr TypeT * | begin () |
| | "Iterator" Begin Function
|
| |
| constexpr TypeT * | end () |
| | "Iterator" End Function
|
| |
| constexpr const TypeT * | begin () const |
| | Const "Iterator" Begin Function.
|
| |
| constexpr const TypeT * | end () const |
| | Const "Iterator" End Function.
|
| |