template<class Iter, class S> int countGreater(Iter first, Iter last, S value)
Returns the number of elements in [first, last) that are greater than value.
Parameters:
first | Beginning iterator for the container of elements. |
---|---|
last | Ending iterator for the container of elements. |
value | Test value. |
Returns:
The number of larger elements.
Usage:
double x[] = {2.0, 1.0, 3.0, 5.0, 4.0, 5.0}; int countGreater(x, x + 6, 3.4);
Header:
#include "ranking.hpp"