Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

queue

Module:  Standard C++ Library   Library:  Containers


Does not inherit

Local Index

Members

Non-Members

Summary

A container adaptor that behaves like a queue (first in, first out)

Synopsis

#include <queue>

namespace std {
  template <class T, class Container = deque<T> > 
  class queue;
}

Description

The queue container adaptor lets a container act as a queue. In a queue, items are pushed into the back of the container and removed from the front. The first items pushed into the queue are the first items to be popped off of the queue (first in, first out, or FIFO).

queue can adapt any container that supports the front(), back(), push_back(), and pop_front() operations. In particular, deque and list can be used.

Interface

Constructors

explicit queue(const Container& = Container());

Member Functions

value_type& 
back();
const value_type& 
back() const;
bool 
empty() const;
value_type& 
front();
const value_type& 
front() const;
void 
pop();
void 
push(const value_type& x);
size_type 
size() const;

Nonmember Operators

template <class T, class Container>
  bool operator==(const queue<T, Container>& x,
                   const queue<T, Container>& y);
template <class T, class Container>
  bool operator!=(const queue<T, Container>& x,
                   const queue<T, Container>& y);
template <class T, class Container>
  bool operator<(const queue<T, Container>& x,
                  const queue<T, Container>& y);
template <class T, class Container>
  bool operator>(const queue<T, Container>& x,
                  const queue<T, Container>& y);
template <class T, class Container>
  bool operator<(const queue<T, Container>& x,
                  const queue<T, Container>& y);
template <class T, class Container>
  bool operator<(const queue<T, Container>& x,
                  const queue<T, Container>& y);

Example

See Also

allocator, Containers, priority_queue

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 23.2.3.1



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.