[stack.syn]

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

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

### 23.6.5 Header <stack> synopsis [stack.syn]

[ð](#header:%3cstack%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 {// [[stack]](stack "23.6.6 Class template stack"), class template stacktemplate<class T, class Container = deque<T>> class stack; template<class T, class Container>constexpr bool operator==(const stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr bool operator!=(const stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr bool operator< (const stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr bool operator> (const stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr bool operator>=(const stack<T, Container>& x, const stack<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 stack<T, Container>& x, const stack<T, Container>& y); template<class T, class Container>constexpr void swap(stack<T, Container>& x, stack<T, Container>& y)noexcept(noexcept(x.swap(y))); template<class T, class Container, class Alloc>struct uses_allocator<stack<T, Container>, Alloc>; // [[container.adaptors.format]](container.adaptors.format "23.6.13 Container adaptors formatting"), formatter specialization for stacktemplate<class charT, class T, [formattable](format.formattable#concept:formattable "28.5.6.3 Concept formattable [format.formattable]")<charT> Container>struct formatter<stack<T, Container>, charT>;}
