A standard container giving FILO behavior.
Meets many of the requirements of a container, but does not define anything to do with iterators. Very few of the other standard container interfaces are defined.
This is not a true container, but an adaptor. It holds another container, and provides a wrapper interface to that container. The wrapper is what enforces strict first-in-last-out stack behavior.
The second template parameter defines the type of the underlying sequence/container. It defaults to std::deque, but it can be any type that supports
pop_front, such as std::list, std::vector, or an appropriate user-defined type.
Members not found in normal containers are
container_type, which is a typedef for the second Sequence parameter, and
top, which are standard stack/FILO operations.
|std::stack::stack||(||const _Sequence &||__c||)||
|bool std::stack::empty||(||)|| const
Removes first element.
This is a typical stack operation. It shrinks the stack by one. The time complexity of the operation depends on the underlying sequence.
Note that no data is returned, and if the first element's data is needed, it should be retrieved before pop() is called.
|void std::stack::push||(||const value_type &||__x||)||
Add data to the top of the stack.
|x||Data to be added.|
This is a typical stack operation. The function creates an element at the top of the stack and assigns the given data to it. The time complexity of the operation depends on the underlying sequence.
|size_type std::stack::size||(||)|| const
|const_reference std::stack::top||(||)|| const