Counting Elements

Count algorithms assist us in counting the number of elements in a range which satisfy a certain predicate.

We can count elements (with or without a predicate) using STL algorithms.

They return the number of elements:

Get hands-on with 1200+ tech skills courses.