std::stack<T,Container>::size
Min standard notice:
Returns the number of elements in the container adaptor. Equivalent to: returnc.size().
# Declarations
size_type size() const;
# Return value
The number of elements in the container adaptor.
# Example
#include <cassert>
#include <stack>
int main()
{
std::stack<int> stack;
assert(stack.size() == 0);
const int count = 8;
for (int i = 0; i != count; ++i)
stack.push(i);
assert(stack.size() == count);
}