class template
std::stack
- Header
<stack>- Draft
- [stack.defn]
- Scope
std- cppreference
- std::stack
Synopsis
template<class T, class Container = deque<T>>
class stack;Member types
| Name | Declaration |
|---|---|
const_referencetype alias · member type | = Container::const_reference |
container_typetype alias · member type | = Container |
referencetype alias · member type | = Container::reference |
size_typetype alias · member type | = Container::size_type |
value_typetype alias · member type | = Container::value_type |
Member functions
| Name | Declaration |
|---|---|
stackconstructor · 12 overloads | stack() +11 more |
emplacemember function template | decltype(auto) emplace(Args&&... args) |
emptymember function | bool empty() const |
popmember function | void pop() |
pushmember function · 2 overloads | void push(const value_type& x) +1 more |
push_rangemember function template | void push_range(R&& rg) |
sizemember function | size_type size() const |
swapmember function | void swap(stack& s) |
topmember function · 2 overloads | reference top() +1 more |
Protected Data members
| Name | Declaration |
|---|---|
cdata member | Container |