Difference between revisions of "cpp/container/stack"
From cppreference.com
(formatting) |
|||
Line 13: | Line 13: | ||
{{param list begin}} | {{param list begin}} | ||
{{param list item | T | The type of the stored elements.}} | {{param list item | T | The type of the stored elements.}} | ||
− | {{param list item | Container | The type of the underlying container to use to store the elements. The container must satisfy the requirements of {{concept| | + | {{param list item | Container | The type of the underlying container to use to store the elements. The container must satisfy the requirements of {{concept|SequenceContainer}}. Additionally, it must provide the following functions with the usual semantics: |
* {{tt|back()}} | * {{tt|back()}} |
Revision as of 06:58, 23 April 2013
Defined in header <stack>
|
||
template< class T, |
||
The std::stack
class is a container adapter that gives the programmer the functionality of a stack - specifically, a LIFO (last-in, first-out) data structure.
Contents |
Template parameters
T | - | The type of the stored elements. |
Container | - | The type of the underlying container to use to store the elements. The container must satisfy the requirements of Template:concept. Additionally, it must provide the following functions with the usual semantics:
The standard containers std::vector, std::deque and std::list satisfy these requirements. |