|
C++ Channel
|
A fixed-size circular buffer using std::array. More...
#include <storage.hpp>
Public Member Functions | |
| template<typename Type > | |
| void | push_back (Type &&value) |
| Adds an element to the back of the array. | |
| void | pop_front (T &out) |
| Marks the front element as removed and moves it to the output. | |
| NODISCARD std::size_t | size () const noexcept |
| Returns the number of elements currently stored. | |
Static Public Attributes | |
| static constexpr std::size_t | capacity = N |
| The storage capacity. | |
A fixed-size circular buffer using std::array.
| T | Type of elements stored. |
| N | Maximum number of elements (capacity). |
Marks the front element as removed 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 array.
| Type | Type of the element to insert. |
| value | The value to insert (perfect forwarded). |
|
inlinenoexcept |
Returns the number of elements currently stored.
|
staticconstexpr |
The storage capacity.