18namespace sequoia::data_structures
25 template<
class T, std::
size_t MaxDepth>
30 : m_Stack{utilities::to_array<T, MaxDepth>(l)}
42 constexpr void push(
const T& val)
45 throw std::logic_error(
"Attempting to exceed max stack depth");
52 constexpr const T& top()
const noexcept
54 return m_Stack[m_End - 1];
57 constexpr void pop()
noexcept
63 constexpr bool empty()
const noexcept
69 constexpr std::size_t size()
const noexcept
77 return (lhs.m_End == rhs.m_End)
78 && std::ranges::equal(lhs.m_Stack.begin(), lhs.m_Stack.begin() + lhs.m_End, rhs.m_Stack.begin(), rhs.m_Stack.begin() + rhs.m_End);
81 std::array<T, MaxDepth> m_Stack{};
A collection of constexpr algorithms.
Utility to convert an initializer_list into an array, potentially transforming the initializer_list i...
A stack suitable for constexpr contexts.
Definition: StaticStack.hpp:27