.TH "std::queue< _Tp, _Sequence >" 3cxx "Tue Jul 2 2019" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::queue< _Tp, _Sequence > \- A standard container giving FIFO 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> \fBqueue\fP ()" .br .RI "Default constructor creates no elements\&. " .ti -1c .RI "\fBqueue\fP (const _Sequence &__c)" .br .ti -1c .RI "\fBqueue\fP (_Sequence &&__c)" .br .ti -1c .RI "template> \fBqueue\fP (const _Alloc &__a)" .br .ti -1c .RI "template> \fBqueue\fP (const _Sequence &__c, const _Alloc &__a)" .br .ti -1c .RI "template> \fBqueue\fP (_Sequence &&__c, const _Alloc &__a)" .br .ti -1c .RI "template> \fBqueue\fP (const \fBqueue\fP &__q, const _Alloc &__a)" .br .ti -1c .RI "template> \fBqueue\fP (\fBqueue\fP &&__q, const _Alloc &__a)" .br .ti -1c .RI "reference \fBback\fP ()" .br .ti -1c .RI "const_reference \fBback\fP () const" .br .ti -1c .RI "template void \fBemplace\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "bool \fBempty\fP () const" .br .ti -1c .RI "reference \fBfront\fP ()" .br .ti -1c .RI "const_reference \fBfront\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 end of the queue\&. " .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 (\fBqueue\fP &__q) noexcept(__is_nothrow_swappable< _Sequence >::value)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "_Sequence \fBc\fP" .br .RI "\fCc\fP is the underlying container\&. " .in -1c .SS "Friends" .in +1c .ti -1c .RI "template bool \fBoperator<\fP (const \fBqueue\fP< _Tp1, _Seq1 > &, const \fBqueue\fP< _Tp1, _Seq1 > &)" .br .ti -1c .RI "template bool \fBoperator==\fP (const \fBqueue\fP< _Tp1, _Seq1 > &, const \fBqueue\fP< _Tp1, _Seq1 > &)" .br .in -1c .SH "Detailed Description" .PP .SS "template> .br class std::queue< _Tp, _Sequence >" A standard container giving FIFO 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-first-out queue 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 \fCfront\fP, \fCback\fP, \fCpush_back\fP, and \fCpop_front\fP, such as std::list 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 and \fCpop\fP, which are standard queue/FIFO operations\&. .PP Definition at line 96 of file stl_queue\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template> template::value>::type> \fBstd::queue\fP< _Tp, _Sequence >::\fBqueue\fP ()\fC [inline]\fP" .PP Default constructor creates no elements\&. .PP Definition at line 152 of file stl_queue\&.h\&. .PP References std::queue< _Tp, _Sequence >::c\&. .SH "Member Function Documentation" .PP .SS "template> reference \fBstd::queue\fP< _Tp, _Sequence >::back ()\fC [inline]\fP" Returns a read/write reference to the data at the last element of the queue\&. .PP Definition at line 224 of file stl_queue\&.h\&. .SS "template> const_reference \fBstd::queue\fP< _Tp, _Sequence >::back () const\fC [inline]\fP" Returns a read-only (constant) reference to the data at the last element of the queue\&. .PP Definition at line 235 of file stl_queue\&.h\&. .SS "template> bool \fBstd::queue\fP< _Tp, _Sequence >::empty () const\fC [inline]\fP" Returns true if the queue is empty\&. .PP Definition at line 189 of file stl_queue\&.h\&. .SS "template> reference \fBstd::queue\fP< _Tp, _Sequence >::front ()\fC [inline]\fP" Returns a read/write reference to the data at the first element of the queue\&. .PP Definition at line 202 of file stl_queue\&.h\&. .SS "template> const_reference \fBstd::queue\fP< _Tp, _Sequence >::front () const\fC [inline]\fP" Returns a read-only (constant) reference to the data at the first element of the queue\&. .PP Definition at line 213 of file stl_queue\&.h\&. .SS "template> void \fBstd::queue\fP< _Tp, _Sequence >::pop ()\fC [inline]\fP" .PP Removes first element\&. This is a typical queue operation\&. It shrinks the queue 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 284 of file stl_queue\&.h\&. .SS "template> void \fBstd::queue\fP< _Tp, _Sequence >::push (const value_type & __x)\fC [inline]\fP" .PP Add data to the end of the queue\&. .PP \fBParameters:\fP .RS 4 \fI__x\fP Data to be added\&. .RE .PP This is a typical queue operation\&. The function creates an element at the end of the queue and assigns the given data to it\&. The time complexity of the operation depends on the underlying sequence\&. .PP Definition at line 251 of file stl_queue\&.h\&. .PP Referenced by std::priority_queue< _Tp, _Sequence, _Compare >::push()\&. .SS "template> size_type \fBstd::queue\fP< _Tp, _Sequence >::size () const\fC [inline]\fP" Returns the number of elements in the queue\&. .PP Definition at line 194 of file stl_queue\&.h\&. .SH "Member Data Documentation" .PP .SS "template> _Sequence \fBstd::queue\fP< _Tp, _Sequence >::c\fC [protected]\fP" .PP \fCc\fP is the underlying container\&. .PP Definition at line 139 of file stl_queue\&.h\&. .PP Referenced by std::operator<(), std::operator==(), std::priority_queue< _Tp, _Sequence, _Compare >::priority_queue(), and std::queue< _Tp, _Sequence >::queue()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.