13 #ifndef RANGES_V3_ALGORITHM_COUNT_IF_HPP
14 #define RANGES_V3_ALGORITHM_COUNT_IF_HPP
27 #include <range/v3/utility/static_const.hpp>
29 #include <range/v3/detail/prologue.hpp>
35 RANGES_FUNC_BEGIN(count_if)
41 constexpr iter_difference_t<I> RANGES_FUNC(count_if)(I
first, S last, R pred, P proj = P{})
43 iter_difference_t<I> n = 0;
51 template(
typename Rng,
typename R,
typename P =
identity)(
52 requires input_range<Rng> AND
54 constexpr iter_difference_t<iterator_t<Rng>>
55 RANGES_FUNC(count_if)(Rng && rng, R pred, P proj = P{})
57 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
60 RANGES_FUNC_END(count_if)
64 using ranges::count_if;
69 #include <range/v3/detail/epilogue.hpp>
template(typename Rng, typename R, typename P=identity)(requires input_range< Rng > AND indirect_unary_predicate< R
This is an overloaded member function, provided for convenience. It differs from the above function o...
CPP_concept sentinel_for
\concept sentinel_for
Definition: concepts.hpp:306
CPP_concept indirect_unary_predicate
\concept indirect_unary_predicate
Definition: concepts.hpp:632
CPP_concept input_iterator
\concept input_iterator
Definition: concepts.hpp:362
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251
Definition: identity.hpp:25