13#include "../defines.h"
24 template <
class T,
int N>
31 PONCA_MULTIARCH
inline Stack();
34 PONCA_MULTIARCH
inline const T&
top()
const;
36 PONCA_MULTIARCH
inline T&
top();
39 PONCA_MULTIARCH
inline bool empty()
const;
41 PONCA_MULTIARCH
inline int size()
const;
48 PONCA_MULTIARCH
inline void push();
52 PONCA_MULTIARCH
inline void pop();
55 PONCA_MULTIARCH
inline void clear();
68 template <
class T,
int N>
73 template <
class T,
int N>
76 return STD_SAFE_AT(m_data, m_size - 1);
79 template <
class T,
int N>
82 return STD_SAFE_AT(m_data, m_size - 1);
85 template <
class T,
int N>
91 template <
class T,
int N>
97 template <
class T,
int N>
100 STD_SAFE_AT(m_data, m_size) =
value;
104 template <
class T,
int N>
110 template <
class T,
int N>
116 template <
class T,
int N>
Aggregator class used to declare specialized structures using CRTP.
Stack with fixed-size storage.
void clear()
Clear the stack content.
std::array< T, N > m_data
Fixed-size data buffer.
void pop()
Pop the last element of the Stack.
int size() const
Get the number of elements in the Stack.
T ValueType
Type of value stored in the Stack.
void push(const T &value)
Add an element on top of the stack.
void push()
Add an element with default initialization.
int m_size
Number of elements in the Stack.
T & top()
Write access to the top element of the Stack.
bool empty() const
Is the stack empty.
const T & top() const
Read access to the top element of the Stack.
This Source Code Form is subject to the terms of the Mozilla Public License, v.