template<typename T>
class Kinoko::fixed_vector< T >
Dynamically sized array that only allocates once.
It's possible that only an upper bound is known for a given vector. However, in the event that there are more objects than expected, we want to error. Effectively, this behaves identically to std::vector<T, EGG::Allocator<T>> except that it cannot be later resized.
- Template Parameters
-
| T | The type of objects in the array. |
Definition at line 177 of file Types.hh.
|
| | fixed_vector () |
| | Non-initializing constructor.
|
| | fixed_vector (size_t capacity) |
| | Initializing constructor.
|
| | fixed_vector (const fixed_vector &rhs) |
| | Copy constructor.
|
| | fixed_vector (fixed_vector &&rhs) |
| | Move constructor.
|
| fixed_vector & | operator= (const fixed_vector &rhs) |
| | Copy assignment operator.
|
| fixed_vector & | operator= (fixed_vector &&rhs) |
| | Move assignment operator.
|
| | ~fixed_vector () |
| | Destructor.
|
| T & | push_back (const T &obj) |
| | Copies a new element into the array.
|
| T & | push_back (T &&obj) |
| | Moves a new element into the array.
|
| template<typename... Args> |
| T & | emplace_back (Args &&...args) |
| | Creates a new element in-place in the array.
|
| void | pop_back () |
| | Deletes the last existing element from the array.
|
| void | reserve (size_t capacity) |
| | Initializes the vector with the provided capacity.
|
| bool | empty () const |
| | Checks if there are no existing elements in the array.
|
| bool | full () const |
| | Checks if all elements exist in the array.
|
| bool | initialized () const |
| | Checks if the array exists and if the capacity is non-zero.
|
| size_t | size () const |
| | Gets the number of existing elements in the array.
|
| size_t | capacity () const |
| | Gets the maximum number of elements that can exist in the array.
|
| T & | front () |
| | Gets the first element in the array.
|
| const T & | front () const |
| | Gets the first element in the array.
|
| T & | back () |
| | Gets the last existing element in the array.
|
| const T & | back () const |
| | Gets the last existing element in the array.
|
| T & | operator[] (size_t idx) |
| | Indexes the array. Validates that the object exists.
|
| const T & | operator[] (size_t idx) const |
| | Indexes the array. Validates that the object exists.
|
| T * | begin () noexcept |
| | Iterator for the beginning of the existing array.
|
| const T * | begin () const noexcept |
| | Iterator for the beginning of the existing array.
|
| T * | end () noexcept |
| | Iterator for the end of the existing array.
|
| const T * | end () const noexcept |
| | Iterator for the end of the existing array.
|