| | | |
| ------------------------------------------------------------------------------------------------------------------------------------------------ | | |
| template< class T, class Container = std::deque<T> > class queue; | | |
The std::queue class template is a container adaptor that gives the functionality of a queue - specifically, a FIFO (first-in, first-out) data structure.
The class template acts as a wrapper to the underlying container - only a specific set of functions is provided. The queue pushes the elements on the back of the underlying container and pops them from the front.
All member functions of std::queue are constexpr: it is possible to create and use std::queue objects in the evaluation of a constant expression.However, std::queue objects generally cannot be constexpr, because any dynamically allocated storage must be released in the same evaluation of constant expression.
ill-formed if T is not the same type as Container::value_type
↑ Such as containers similar to std::vector with additional support of pop_front(). The resolution of this DR added support of std::vector for std::stack and std::priority_queue. The changes involving std::queue are for maintaining consistency.