Namespaces
Variants

Standard library header <stack>

From cppreference.com
 
 
Standard library headers
 

This header is part of the containers library.

Includes

(C++20)
Three-way comparison operator support[edit]
std::initializer_list class template[edit]

Classes

adapts a container to provide stack (LIFO data structure)
(class template) [edit]
specializes the std::uses_allocator type trait
(class template specialization) [edit]

Functions

lexicographically compares the values of two stacks
(function template) [edit]
specializes the std::swap algorithm
(function template) [edit]

Synopsis

#include <compare>
#include <initializer_list>

namespace std {
  // class template stack
  template<class T, class Container = deque<T>>
  class stack;

  template<class T, class Container>
  bool operator==(const stack<T, Container>& x, const stack<T, Container>& y);
  template<class T, class Container>
  bool operator!=(const stack<T, Container>& x, const stack<T, Container>& y);
  template<class T, class Container>
  bool operator<(const stack<T, Container>& x, const stack<T, Container>& y);
  template<class T, class Container>
  bool operator>(const stack<T, Container>& x, const stack<T, Container>& y);
  template<class T, class Container>
  bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y);
  template<class T, class Container>
  bool operator>=(const stack<T, Container>& x, const stack