|
KTL
|
A dynamically alloacted array of trivial types. More...
#include <trivial_array.h>
Public Types | |
| typedef T * | iterator |
| typedef const T * | const_iterator |
| typedef std::reverse_iterator< T * > | reverse_iterator |
| typedef std::reverse_iterator< const T * > | const_reverse_iterator |
Public Member Functions | |
| trivial_array () noexcept | |
| Construct the array with a default constructed allocator. More... | |
| trivial_array (const Alloc &allocator) noexcept | |
| Construct the array with the given allocator. More... | |
| trivial_array (size_t n, const Alloc &allocator=Alloc()) | |
| Construct the array with the given allocator and size. More... | |
| trivial_array (size_t n, const T &value, const Alloc &allocator=Alloc()) | |
| Construct the array with the given allocator, size and default value. More... | |
| trivial_array (std::initializer_list< T > initializer, const Alloc &allocator=Alloc()) | |
| Construct the array with the allocator and range of values. More... | |
| trivial_array (const T *first, const T *last, const Alloc &allocator=Alloc()) | |
| Construct the array with the allocator and range of values. More... | |
| trivial_array (const trivial_array &other) noexcept | |
| trivial_array (trivial_array &&other) noexcept | |
| trivial_array (const trivial_array &other, const Alloc &allocator) noexcept | |
| trivial_array (trivial_array &&other, const Alloc &allocator) noexcept | |
| ~trivial_array () noexcept | |
| trivial_array & | operator= (const trivial_array &other) noexcept |
| trivial_array & | operator= (trivial_array &&other) noexcept |
| T & | operator[] (size_t index) noexcept |
Returns a reference to the element at index. More... | |
| const T & | operator[] (size_t index) const noexcept |
Returns a reference to the element at index. More... | |
| iterator | begin () noexcept |
| const_iterator | begin () const noexcept |
| iterator | end () noexcept |
| const_iterator | end () const noexcept |
| std::reverse_iterator< T * > | rbegin () noexcept |
| std::reverse_iterator< const T * > | rbegin () const noexcept |
| std::reverse_iterator< T * > | rend () noexcept |
| std::reverse_iterator< const T * > | rend () const noexcept |
| size_t | size () const noexcept |
| Returns the current size of the array. More... | |
| bool | empty () const noexcept |
| Returns true if the array has been initialized with no size. More... | |
| iterator | data () noexcept |
| Returns an iterator to the start of the array. More... | |
| const_iterator | data () const noexcept |
| Returns a const iterator to the start of the array. More... | |
| T & | at (size_t index) const noexcept |
Returns a reference to the element at index. More... | |
| void | resize (size_t n) |
| Resizes the array to the given size. More... | |
| void | assign (const T *first, const T *last) |
Assigns the given values from first to last. It also resizes if the size doesn't match the number of elements. More... | |
A dynamically alloacted array of trivial types.
| T | The type to use. Must be trivially copyable and default constructible |
| Alloc | The type of allocoator to use |
| typedef const T* ktl::trivial_array< T, Alloc >::const_iterator |
| typedef std::reverse_iterator<const T*> ktl::trivial_array< T, Alloc >::const_reverse_iterator |
| typedef T* ktl::trivial_array< T, Alloc >::iterator |
| typedef std::reverse_iterator<T*> ktl::trivial_array< T, Alloc >::reverse_iterator |
|
inlinenoexcept |
Construct the array with a default constructed allocator.
|
inlinenoexcept |
Construct the array with the given allocator.
| allocator | The allocator to use |
|
inlineexplicit |
Construct the array with the given allocator and size.
| n | The size of the array |
| allocator | The allocator to use. Will be default constructed if unspecified |
|
inlineexplicit |
Construct the array with the given allocator, size and default value.
| n | The size of the array |
| value | The value to initialize every element as |
| allocator | The allocator to use. Will be default constructed if unspecified |
|
inline |
Construct the array with the allocator and range of values.
| initializer | The initial set of values |
| allocator | The allocator to use. Will be default constructed if unspecified |
|
inlineexplicit |
Construct the array with the allocator and range of values.
| first | A pointer to the first element |
| last | A pointer past the last element |
| allocator | The allocator to use. Will be default constructed if unspecified |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Assigns the given values from first to last. It also resizes if the size doesn't match the number of elements.
| first | A pointer to the first element. |
| last | A pointer one element past the last element. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a const iterator to the start of the array.
|
inlinenoexcept |
Returns an iterator to the start of the array.
|
inlinenoexcept |
Returns true if the array has been initialized with no size.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Resizes the array to the given size.
| n | The size to resize to. |
|
inlinenoexcept |
Returns the current size of the array.