diff options
author | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
---|---|---|
committer | Wang Pengcheng <wangpengcheng.pp@bytedance.com> | 2024-04-17 21:47:29 +0800 |
commit | 7d1b70a3960cdacfa4d7531531a9a921dadd3d88 (patch) | |
tree | ac207bdf9fcb3c3656deafb734acd8f03b40c8db /libcxx/include/__algorithm/pstl_count.h | |
parent | c9d96c0d77b67c208aaf7f8f2554f972baa412d2 (diff) | |
parent | e77f6742143d71161f3f1161270648c9b95b2137 (diff) | |
download | llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.zip llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.tar.gz llvm-users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns.tar.bz2 |
Rebase on #88868users/wangpc-pp/spr/riscv-dont-use-v0-directly-in-patterns
Created using spr 1.3.6-beta.1
Diffstat (limited to 'libcxx/include/__algorithm/pstl_count.h')
-rw-r--r-- | libcxx/include/__algorithm/pstl_count.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/include/__algorithm/pstl_count.h b/libcxx/include/__algorithm/pstl_count.h index 2781f6b..6ff57ca 100644 --- a/libcxx/include/__algorithm/pstl_count.h +++ b/libcxx/include/__algorithm/pstl_count.h @@ -17,6 +17,7 @@ #include <__atomic/atomic.h> #include <__config> #include <__functional/operations.h> +#include <__iterator/cpp17_iterator_concepts.h> #include <__iterator/iterator_traits.h> #include <__numeric/pstl_transform_reduce.h> #include <__type_traits/enable_if.h> @@ -70,6 +71,8 @@ template <class _ExecutionPolicy, enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> _LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> count_if(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "count_if(first, last, pred) requires [first, last) to be ForwardIterators"); auto __res = std::__count_if(__policy, std::move(__first), std::move(__last), std::move(__pred)); if (!__res) std::__throw_bad_alloc(); @@ -106,6 +109,8 @@ template <class _ExecutionPolicy, enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0> _LIBCPP_HIDE_FROM_ABI __iter_diff_t<_ForwardIterator> count(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { + _LIBCPP_REQUIRE_CPP17_FORWARD_ITERATOR( + _ForwardIterator, "count(first, last, val) requires [first, last) to be ForwardIterators"); auto __res = std::__count(__policy, std::move(__first), std::move(__last), __value); if (!__res) std::__throw_bad_alloc(); |