|
Refureku v2.2.0
C++17 runtime reflection library.
|
Public Types | |
| using | value_type = T |
| using | allocator_type = Allocator |
| using | reference = value_type & |
| using | const_reference = value_type const & |
Public Member Functions | |
| Vector (std::size_t initialCapacity=0u) noexcept | |
| template<typename U , typename UAlloc > | |
| Vector (Vector< U, UAlloc > &&) noexcept | |
| Vector (Vector const &) | |
| Vector (Vector &&) noexcept | |
| T & | front () noexcept |
| Get a reference to the first element of the vector. The behaviour is undefined if the vector is empty. More... | |
| T const & | front () const noexcept |
| T & | back () noexcept |
| Get a reference to the last element of the vector. The behaviour is undefined if the vector is empty. More... | |
| T const & | back () const noexcept |
| T * | data () noexcept |
| Get a pointer to the underlying allocated memory. More... | |
| T const * | data () const noexcept |
| void | reserve (std::size_t capacity) |
| Reallocate the underlying memory to have enough space to fit capacity elements. No reallocation happens if the provided capacity is equal or smaller than the current capacity. More... | |
| void | resize (std::size_t size) |
| Resize the vector so that it has exactly the specified size. Reallocation occurs if the size is greater than the current capacity. Objects are default constructed if the specified size is greater than the current size. More... | |
| std::size_t | size () const noexcept |
| Get the number of elements stored in the vector. More... | |
| std::size_t | capacity () const noexcept |
| Get the maximum number of elements storable in the vector without reallocation. More... | |
| bool | empty () const noexcept |
| Check if the container contains no elements. More... | |
| void | clear () |
| Remove all elements from the vector. | |
| void | push_back (T const &value) |
| Add an element to the vector. More... | |
| void | push_back (T &&value) |
| Add an element to the vector. More... | |
| void | push_back (Vector const &other) |
| Add all elements from a vector at the end of this vector. More... | |
| void | push_back (Vector &&other) |
| void | insert (std::size_t index, T const &element) |
| Insert an element at a specified index. More... | |
| void | insert (std::size_t index, T &&element) |
| Insert an element at a specified index. More... | |
| template<typename... Args> | |
| T & | emplace_back (Args &&... args) |
| Construct in place an element at the end of the vector with the provided arguments. More... | |
| T * | begin () noexcept |
| Get a pointer to the first element. If the vector is empty, the pointed memory is undefined. More... | |
| T const * | begin () const noexcept |
| T const * | cbegin () const noexcept |
| T * | end () noexcept |
| Get a pointer past the last element. More... | |
| T const * | end () const noexcept |
| T const * | cend () const noexcept |
| T & | operator[] (std::size_t index) noexcept |
| Access the index(th) element in the vector. More... | |
| T const & | operator[] (std::size_t index) const noexcept |
| Vector & | operator= (Vector const &) |
| Vector & | operator= (Vector &&) noexcept |
|
noexcept |
Retrieve data from another type U. NOT SAFE UNLESS YOU EXACTLY KNOW WHAT YOU DO.
|
noexcept |
Get a reference to the last element of the vector. The behaviour is undefined if the vector is empty.
|
noexcept |
Get a pointer to the first element. If the vector is empty, the pointed memory is undefined.
|
noexcept |
Get the maximum number of elements storable in the vector without reallocation.
|
noexcept |
Get a pointer to the underlying allocated memory.
| T & rfk::Vector< T, Allocator >::emplace_back | ( | Args &&... | args | ) |
Construct in place an element at the end of the vector with the provided arguments.
| ... | args Args forwarded to the object constructor. |
|
noexcept |
Check if the container contains no elements.
|
noexcept |
Get a pointer past the last element.
|
noexcept |
Get a reference to the first element of the vector. The behaviour is undefined if the vector is empty.
| void rfk::Vector< T, Allocator >::insert | ( | std::size_t | index, |
| T && | element | ||
| ) |
Insert an element at a specified index.
| index | Index of the element in the vector. |
| element | Element to insert. |
| void rfk::Vector< T, Allocator >::insert | ( | std::size_t | index, |
| T const & | element | ||
| ) |
Insert an element at a specified index.
| index | Index of the element in the vector. |
| element | Element to insert. |
|
noexcept |
Access the index(th) element in the vector.
| index | Index of the element to access. |
| void rfk::Vector< T, Allocator >::push_back | ( | T && | value | ) |
Add an element to the vector.
| value | The object to forward. |
| void rfk::Vector< T, Allocator >::push_back | ( | T const & | value | ) |
Add an element to the vector.
| value | The object to copy. |
| void rfk::Vector< T, Allocator >::push_back | ( | Vector< T, Allocator > const & | other | ) |
Add all elements from a vector at the end of this vector.
| other | The vector which elements must be copied. |
| void rfk::Vector< T, Allocator >::reserve | ( | std::size_t | capacity | ) |
Reallocate the underlying memory to have enough space to fit capacity elements. No reallocation happens if the provided capacity is equal or smaller than the current capacity.
| capacity | New capacity. |
| void rfk::Vector< T, Allocator >::resize | ( | std::size_t | size | ) |
Resize the vector so that it has exactly the specified size. Reallocation occurs if the size is greater than the current capacity. Objects are default constructed if the specified size is greater than the current size.
| size | The new size. |
|
noexcept |
Get the number of elements stored in the vector.