2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 [section:count_if count_if]
11 template<class SinglePassRange, class UnaryPredicate>
12 typename range_difference<const SinglePassRange>::type
13 count_if(const SinglePassRange& rng, UnaryPredicate pred);
18 `count_if` returns the number of elements `x` in `rng` where `pred(x)` is `true`.
22 Defined in the header file `boost/range/algorithm/count_if.hpp`
24 [heading Requirements]
26 * `SinglePassRange` is a model of the __single_pass_range__ Concept.
27 * `UnaryPredicate` is a model of the `UnaryPredicateConcept`.
28 * `SinglePassRange`'s value type is a model of the `EqualityComparableConcept`.
29 * The value type of `SinglePassRange` is convertible to the argument type of `UnaryPredicate`.
33 Linear. Exactly `distance(rng)` invocations of `pred`.