diff options
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index d86cfe7..401e918 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -145,6 +145,26 @@ namespace ranges { constexpr ranges::binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O> transform(R1&& r1, R2&& r2, O result, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // since C++20 + + template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity> + requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*> + constexpr iter_difference_t<I> + count(I first, S last, const T& value, Proj proj = {}); // since C++20 + + template<input_range R, class T, class Proj = identity> + requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*> + constexpr range_difference_t<R> + count(R&& r, const T& value, Proj proj = {}); // since C++20 + + template<input_iterator I, sentinel_for<I> S, class Proj = identity, + indirect_unary_predicate<projected<I, Proj>> Pred> + constexpr iter_difference_t<I> + count_if(I first, S last, Pred pred, Proj proj = {}); // since C++20 + + template<input_range R, class Proj = identity, + indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred> + constexpr range_difference_t<R> + count_if(R&& r, Pred pred, Proj proj = {}); // since C++20 } constexpr bool // constexpr in C++20 @@ -862,6 +882,8 @@ template <class BidirectionalIterator, class Compare> #include <__algorithm/pop_heap.h> #include <__algorithm/prev_permutation.h> #include <__algorithm/push_heap.h> +#include <__algorithm/ranges_count.h> +#include <__algorithm/ranges_count_if.h> #include <__algorithm/ranges_find.h> #include <__algorithm/ranges_find_if.h> #include <__algorithm/ranges_find_if_not.h> |