function object
std::ranges::count_if
- Header
<algorithm>- Draft
- [alg.count]
- Scope
std::ranges- cppreference
- std::ranges::count_if
Synopsis
inline constexpr /* implementation-defined */ count_if = {};Call signatures
count_if is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.
- (1)
template< std::ranges::input_range R, class Proj = std::identity, std::indirect_unary_predicate<std::projected<iterator_t<R>, Proj>> Pred> [[nodiscard]] constexpr std::ranges::range_difference_t<R> count_if( R&& r, Pred pred, Proj proj = {}); - (2)
template< std::input_iterator I, std::sentinel_for<I> S, class Proj = std::identity, std::indirect_unary_predicate<std::projected<I, Proj>> Pred> [[nodiscard]] constexpr std::iter_difference_t<I> count_if( I first, S last, Pred pred, Proj proj = {}); - (3)
template< class ExecutionPolicy, std::random_access_iterator I, std::sized_sentinel_for<I> S, class Proj = std::identity, std::indirect_unary_predicate<std::projected<I, Proj>> Pred> requires execution-policy<ExecutionPolicy> decltype(auto) count_if( ExecutionPolicy&&, I first, S last, Pred pred, Proj proj = {}) noexcept; - (4)
template< class ExecutionPolicy, sized-random-access-range R, class Proj = std::identity, std::indirect_unary_predicate<std::projected<std::ranges::iterator_t<R>, Proj>> Pred> requires execution-policy<ExecutionPolicy> decltype(auto) count_if( ExecutionPolicy&&, R&& r, Pred pred, Proj proj = {}) noexcept;