Home | Libraries | People | FAQ | More |
template<class SinglePassRange, class UnaryPredicate> typename range_difference<const SinglePassRange>::type count_if(const SinglePassRange& rng, UnaryPredicate pred);
count_if
returns the
number of elements x
in rng
where pred(x)
is true
.
Defined in the header file boost/range/algorithm/count_if.hpp
SinglePassRange
is
a model of the Single
Pass Range Concept.
UnaryPredicate
is a
model of the UnaryPredicateConcept
.
SinglePassRange
's value
type is a model of the EqualityComparableConcept
.
SinglePassRange
is convertible to the argument type of UnaryPredicate
.
Linear. Exactly distance(rng)
invocations of pred
.