public member function
<stack>
std::stack::pop
Remove top element
The element removed is the latest element inserted into the stack, whose value can be retrieved by calling member stack::top.
This calls the removed element's destructor.
This member function effectively calls the member function pop_back of the underlying container object.
Parameters
noneReturn value
noneExample
|
|
Output:
Popping out elements... 4 3 2 1 0
Complexity
Constant (calling pop_back on the underlying container).Data races
The container and up to all its contained elements are modified.Exception safety
Provides the same level of guarantees as the operation performed on the underlying container object.See also
- stack::push
- Insert element (public member function)
- stack::empty
- Test whether container is empty (public member function)