queue
|
 |
An adapter used with any
container that supports push_back() and pop_front()
as a first-in, first-out data structure.
Library
Standards<ToolKit>
Declaration
#include <queue>
template< class T, class Container >
class queue
Interface
Constructor
queue()
Constructs an empty
queue, using Container (default deque<
T > ) as the queue's internal data structure.
Constructor
explicit
queue( typename Container::allocator_type&
alloc )
Constructs an empty
queue, using Container (default deque<
T > ) as the queue's internal data structure, and using alloc
to manage storage.
Destructor
~queue()
Destroys the queue and
erases all of its items.
back
T&
back()
Returns a reference to
the queue's last element.
back
const
T& back() const
Returns a constant
reference to the queue's last element.
empty
bool
empty() const
Returns true
if the queue contains no elements.
front
T&
front()
Returns a reference to
the queue's first element.
front
const
T& front() const
Returns a constant
reference to the queue's first element.
pop
void
pop()
Erases the queue's top
element.
push
void
push( const T& value )
Pushes a copy of value
.
size
size_type
size() const
Returns the number of
elements in the queue.
Non-Member Functions
==
bool
operator==( const queue< T, Container, Allocator >& x
, const queue< T, Container,
Allocator >& y )
Returns true
if x contains the same items in the same order as y
.
<
bool
operator<( const queue< T, Container, Allocator >& x,
const queue< T, Container,
Allocator >& y )
Returns true
if x is lexicographically less than y
.
Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.