A standard container giving FIFO behavior.
Meets many of the requirements of a container, but does not define anything to do with iterators. Very few of the other standard container interfaces are defined.
This is not a true container, but an adaptor. It holds another container, and provides a wrapper interface to that container. The wrapper is what enforces strict first-in-first-out queue behavior.
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
pop_front, such as std::list or an appropriate user-defined type.
Members not found in normal containers are
container_type, which is a typedef for the second Sequence parameter, and
pop, which are standard queue/FIFO operations.
|std::queue::queue||(||const _Sequence &||__c||)||
|const_reference std::queue::back||(||)|| const
|bool std::queue::empty||(||)|| const
|const_reference std::queue::front||(||)|| const
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.
Note that no data is returned, and if the first element's data is needed, it should be retrieved before pop() is called.
|void std::queue::push||(||const value_type &||__x||)||
Add data to the end of the queue.
|x||Data to be added.|
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.
|size_type std::queue::size||(||)|| const
'c' is the underlying container. Maintainers wondering why this isn't uglified as per style guidelines should note that this name is specified in the standard, [184.108.40.206]. (Why? Presumably for the same reason that it's protected instead of private: to allow derivation. But none of the other containers allow for derivation. Odd.)
Referenced by std::operator<().