.TH "std::stack< _Tp, _Sequence >" 3cxx "Mon May 22 2017" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::stack< _Tp, _Sequence > \- A standard container giving FILO behavior\&. .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _Sequence::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef _Sequence \fBcontainer_type\fP" .br .ti -1c .RI "typedef _Sequence::reference \fBreference\fP" .br .ti -1c .RI "typedef _Sequence::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Sequence::value_type \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "template::value>::type> \fBstack\fP ()" .br .RI "Default constructor creates no elements\&. " .ti -1c .RI "\fBstack\fP (const _Sequence &__c)" .br .ti -1c .RI "\fBstack\fP (_Sequence &&__c)" .br .ti -1c .RI "template> \fBstack\fP (const _Alloc &__a)" .br .ti -1c .RI "template> \fBstack\fP (const _Sequence &__c, const _Alloc &__a)" .br .ti -1c .RI "template> \fBstack\fP (_Sequence &&__c, const _Alloc &__a)" .br .ti -1c .RI "template> \fBstack\fP (const \fBstack\fP &__q, const _Alloc &__a)" .br .ti -1c .RI "template> \fBstack\fP (\fBstack\fP &&__q, const _Alloc &__a)" .br .ti -1c .RI "template void \fBemplace\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "bool \fBempty\fP () const" .br .ti -1c .RI "void \fBpop\fP ()" .br .RI "Removes first element\&. " .ti -1c .RI "void \fBpush\fP (const value_type &__x)" .br .RI "Add data to the top of the stack\&. " .ti -1c .RI "void \fBpush\fP (value_type &&__x)" .br .ti -1c .RI "size_type \fBsize\fP () const" .br .ti -1c .RI "void \fBswap\fP (\fBstack\fP &__s) noexcept(__is_nothrow_swappable< _Sequence >::value)" .br .ti -1c .RI "reference \fBtop\fP ()" .br .ti -1c .RI "const_reference \fBtop\fP () const" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "_Sequence \fBc\fP" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "template bool \fBoperator<\fP (const \fBstack\fP< _Tp1, _Seq1 > &, const \fBstack\fP< _Tp1, _Seq1 > &)" .br .ti -1c .RI "template bool \fBoperator==\fP (const \fBstack\fP< _Tp1, _Seq1 > &, const \fBstack\fP< _Tp1, _Seq1 > &)" .br .in -1c .SH "Detailed Description" .PP .SS "template> .br class std::stack< _Tp, _Sequence >" A standard container giving FILO behavior\&. .PP \fBTemplate Parameters:\fP .RS 4 \fI_Tp\fP Type of element\&. .br \fI_Sequence\fP Type of underlying sequence, defaults to deque<_Tp>\&. .RE .PP Meets many of the requirements of a \fCcontainer\fP, but does not define anything to do with iterators\&. Very few of the other standard container interfaces are defined\&. .PP This is not a true container, but an \fIadaptor\fP\&. It holds another container, and provides a wrapper interface to that container\&. The wrapper is what enforces strict first-in-last-out stack behavior\&. .PP 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 \fCback\fP, \fCpush_back\fP, and \fCpop_front\fP, such as std::list, std::vector, or an appropriate user-defined type\&. .PP Members not found in \fInormal\fP containers are \fCcontainer_type\fP, which is a typedef for the second Sequence parameter, and \fCpush\fP, \fCpop\fP, and \fCtop\fP, which are standard stack/FILO operations\&. .PP Definition at line 99 of file stl_stack\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template> template::value>::type> \fBstd::stack\fP< _Tp, _Sequence >::\fBstack\fP ()\fC [inline]\fP" .PP Default constructor creates no elements\&. .PP Definition at line 148 of file stl_stack\&.h\&. .PP Referenced by std::stack< _StateSeqT >::stack()\&. .SH "Member Function Documentation" .PP .SS "template> bool \fBstd::stack\fP< _Tp, _Sequence >::empty () const\fC [inline]\fP" Returns true if the stack is empty\&. .PP Definition at line 185 of file stl_stack\&.h\&. .SS "template> void \fBstd::stack\fP< _Tp, _Sequence >::pop ()\fC [inline]\fP" .PP 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\&. .PP Note that no data is returned, and if the first element's data is needed, it should be retrieved before pop() is called\&. .PP Definition at line 258 of file stl_stack\&.h\&. .SS "template> void \fBstd::stack\fP< _Tp, _Sequence >::push (const value_type & __x)\fC [inline]\fP" .PP Add data to the top of the stack\&. .PP \fBParameters:\fP .RS 4 \fI__x\fP Data to be added\&. .RE .PP 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\&. .PP Definition at line 225 of file stl_stack\&.h\&. .PP Referenced by std::stack< _StateSeqT >::push()\&. .SS "template> size_type \fBstd::stack\fP< _Tp, _Sequence >::size () const\fC [inline]\fP" Returns the number of elements in the stack\&. .PP Definition at line 190 of file stl_stack\&.h\&. .SS "template> reference \fBstd::stack\fP< _Tp, _Sequence >::top ()\fC [inline]\fP" Returns a read/write reference to the data at the first element of the stack\&. .PP Definition at line 198 of file stl_stack\&.h\&. .SS "template> const_reference \fBstd::stack\fP< _Tp, _Sequence >::top () const\fC [inline]\fP" Returns a read-only (constant) reference to the data at the first element of the stack\&. .PP Definition at line 209 of file stl_stack\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.