std::list<T,Allocator>::size
Min standard notice:
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
# Declarations
size_type size() const;
(until C++11)
size_type size() const noexcept;
(since C++11)
# Return value
The number of elements in the container.
# Example
#include <iostream>
#include <list>
int main()
{
std::list<int> nums{1, 3, 5, 7};
std::cout << "nums contains " << nums.size() << " elements.\n";
}