[queue.syn]

# 23 Containers library [[containers]](./#containers)

## 23.6 Container adaptors [[container.adaptors]](container.adaptors#queue.syn)

### 23.6.2 Header <queue> synopsis [queue.syn]

[ð](#header:%3cqueue%3e)

#include <compare> // see [[compare.syn]](compare.syn "17.12.1 Header <compare> synopsis")#include <initializer_list> // see [[initializer.list.syn]](initializer.list.syn "17.11.2 Header <initializer_­list> synopsis")namespace std {// [[queue]](queue "23.6.3 Class template queue"), class template queuetemplate<class T, class Container = deque<T>> class queue; template<class T, class Container>constexpr bool operator==(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator!=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator< (const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator> (const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator<=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr bool operator>=(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]") Container>constexpr compare_three_way_result_t<Container>operator<=>(const queue<T, Container>& x, const queue<T, Container>& y); template<class T, class Container>constexpr void swap(queue<T, Container>& x, queue<T, Container>& y)noexcept(noexcept(x.swap(y))); template<class T, class Container, class Alloc>struct uses_allocator<queue<T, Container>, Alloc>; // [[container.adaptors.format]](container.adaptors.format "23.6.13 Container adaptors formatting"), formatter specialization for queuetemplate<class charT, class T, [formattable](format.formattable#concept:formattable "28.5.6.3 Concept formattable [format.formattable]")<charT> Container>struct formatter<queue<T, Container>, charT>; // [[priority.queue]](priority.queue "23.6.4 Class template priority_­queue"), class template priority_queuetemplate<class T, class Container = vector<T>, class Compare = less<typename Container::value_type>>class priority_queue; template<class T, class Container, class Compare>constexpr void swap(priority_queue<T, Container, Compare>& x,
 priority_queue<T, Container, Compare>& y) noexcept(noexcept(x.swap(y))); template<class T, class Container, class Compare, class Alloc>struct uses_allocator<priority_queue<T, Container, Compare>, Alloc>; // [[container.adaptors.format]](container.adaptors.format "23.6.13 Container adaptors formatting"), formatter specialization for priority_queuetemplate<class charT, class T, [formattable](format.formattable#concept:formattable "28.5.6.3 Concept formattable [format.formattable]")<charT> Container, class Compare>struct formatter<priority_queue<T, Container, Compare>, charT>;}
