![]() |
![]()
| ![]() |
![]()
NAMEstd::list::size - std::list::size Synopsis size_type size() const; (until C++11)
Parameters(none) Return valueThe number of elements in the container. Complexity Constant or linear. (until C++11)
ExampleThe following code uses size to display the number of elements in a std::list: // Run this code
Output:nums contains 4 elements. See also empty checks whether the container is empty
|