C++ Channel
|
A FIFO queue storage using std::vector. More...
#include <storage.hpp>
Public Member Functions | |
vector_storage (std::size_t capacity) | |
Constructs a queue storage with a given capacity. | |
template<typename Type > | |
void | push_back (Type &&value) |
Adds an element to the back of the vector. | |
void | pop_front (T &out) |
Removes the front element from the vector and moves it to the output. | |
NODISCARD std::size_t | size () const noexcept |
Returns the number of elements currently stored. | |
A FIFO queue storage using std::vector.
T | Type of elements stored. |
|
inlineexplicit |
Constructs a queue storage with a given capacity.
capacity | Maximum number of elements the storage can hold. |
Removes the front element from the vector and moves it to the output.
out | Reference to the variable where the front element will be moved. |
|
inline |
Adds an element to the back of the vector.
Type | Type of the element to insert. |
value | The value to insert (perfect forwarded). |
|
inlinenoexcept |
Returns the number of elements currently stored.