| | | |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | | |
| template< class T, class Container = std::deque<T> > class stack; | | |
The std::stack class is a container adaptor that gives the programmer the functionality of a stack - specifically, a LIFO (last-in, first-out) data structure.
The class template acts as a wrapper to the underlying container - only a specific set of functions is provided. The stack pushes and pops the element from the back of the underlying container, known as the top of the stack.
All member functions of std::stack are constexpr: it is possible to create and use std::stack objects in the evaluation of a constant expression.However, std::stack objects generally cannot be constexpr, because any dynamically allocated storage must be released in the same evaluation of constant expression.