Standard C++ Library Reference ISO/IEC (VERSION3)

stack
template<class Ty,
class Container = deque<Ty> >
class stack {
public:
typedef Container container_type;
typedef typename Container::value_type value_type;
typedef typename Container::size_type size_type;
stack();
explicit stack(const container_type& cont);
bool empty() const;
size_type size() const;
value_type& top();
const value_type& top() const;
void push(const value_type& val);
void pop();
protected:
Container c;
};
The template class describes an object that controls a varying-length sequence of elements. The
object allocates and frees storage for the sequence it controls through a protected object named
c, of class Container. The type Ty of elements in the controlled sequence must match
value_type.
An object of class Container must supply several public members defined the same as for
deque, list, and vector (all of which are suitable candidates for class Container). The
required members are:
typedef Ty value_type;
typedef T0 size_type;
Container();
bool empty() const;
size_type size() const;
value_type& back();
const value_type& back() const;
void push_back(const value_type& val);
void pop_back();
bool operator==(const Container& cont) const;
bool operator!=(const Container& cont) const;
bool operator<(const Container& cont) const;
bool operator>(const Container& cont) const;
bool operator<=(const Container& cont) const;