16#ifndef IOX_HOOFS_CXX_STACK_HPP
17#define IOX_HOOFS_CXX_STACK_HPP
19#include "iceoryx_hoofs/cxx/optional.hpp"
29template <
typename T, u
int64_t Capacity>
41 template <typename... Targs>
42 bool push(Targs&&... args) noexcept;
45 uint64_t
size() const noexcept;
51 using element_t = uint8_t[sizeof(T)];
52 alignas(T) element_t m_data[Capacity];
58#include "iceoryx_hoofs/internal/cxx/stack.inl"
Optional implementation from the C++17 standard with C++11. The interface is analog to the C++17 stan...
Definition optional.hpp:69
stack implementation with a simple push pop interface
Definition stack.hpp:31
uint64_t size() const noexcept
returns the stack size
bool push(Targs &&... args) noexcept
pushed an element into the stack by forwarding all arguments to the constructor of T
static constexpr uint64_t capacity() noexcept
returns the stack capacity
cxx::optional< T > pop() noexcept
returns the last pushed element when the stack contains elements otherwise a cxx::nullopt
building block to easily create free function for logging in a library context
Definition lockfree_queue.hpp:29