|
pstore2
|
A simple wrapper for std::array which provides the functionality of a stack, specifically a FILO (first-in, last-out) data structure. More...
#include <array_stack.hpp>
Public Member Functions | |
| bool | operator== (array_stack const &other) const |
| bool | operator!= (array_stack const &other) const |
| container_type::const_iterator | begin () const |
| Returns an iterator pointing to the first element in the stack. | |
| container_type::const_iterator | end () const |
| Returns an iterator pointing to the past-the-end element in the array container. | |
Capacity | |
| constexpr bool | empty () const noexcept |
| Checks whether the stack is empty. | |
| constexpr size_type | size () const noexcept |
| Returns the number of elements stored on the stack. | |
| constexpr size_t | max_size () const noexcept |
| Returns the maximum number of elements that the stack is able to hold. More... | |
Element access | |
| reference | top () noexcept |
| Acceses the top element. | |
| const_reference | top () const noexcept |
| Acceses the top element. | |
Modifiers | |
| void | push (value_type const &value) |
| Inserts an element at the top of the container. More... | |
| void | push (value_type &&value) |
| Inserts an element at the top of the container. More... | |
| void | pop () |
| Remove the top element from the stack. | |
A simple wrapper for std::array which provides the functionality of a stack, specifically a FILO (first-in, last-out) data structure.
Its interface is close to that of std::stack<>, but an additional class is necessary because std::array<> does not fully meet the requirements of std::stack<>.
Use this class if the stack size is known a priori to be small and of known maximum depth.
|
inlinenoexcept |
Returns the maximum number of elements that the stack is able to hold.
|
inline |
Inserts an element at the top of the container.
| value | The value of the element to push |
|
inline |
Inserts an element at the top of the container.
| value | The value of the element to push |
1.8.13