15.7.2. queue Adapter

A queue is similar to a waiting line. The item that has been in the queue the longest is the next one removed—so a queue is referred to as a first-in, first-out (FIFO) data structure. Class queue (from header <queue> ) enables insertions at the back of the underlying data structure and deletions from the front. A queue can store its elements in objects of the Standard Library’s list or deque containers. By default, a queue is implemented with a deque. The common queue operations are push to insert an element at the back of the queue (implemented by calling function push_back of the underlying container), pop to remove the element at the front of the queue (implemented by calling function pop_front of the underlying container), ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.