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.
Definition at line 98 of file stl_stack.h.
|std::stack< _Tp, _Sequence >::stack||(||const _Sequence &|| __c =
|bool std::stack< _Tp, _Sequence >::empty||(||)|| const
|void std::stack< _Tp, _Sequence >::pop||(||)||
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< _Tp, _Sequence >::push||(||const value_type &||__x||)||
Add data to the top of the stack.
|x||Data to be added.|
|size_type std::stack< _Tp, _Sequence >::size||(||)|| const
|const_reference std::stack< _Tp, _Sequence >::top||(||)|| const
|reference std::stack< _Tp, _Sequence >::top||(||)||