[libcxx-commits] [libcxx] [libc++][pstl] Generic implementation of parallel std::is_sorted (PR #176129)
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 24 03:07:22 PST 2026
================
@@ -654,6 +654,30 @@ _LIBCPP_HIDE_FROM_ABI _ForwardOutIterator transform(
std::move(__op));
}
+template <class _ExecutionPolicy,
+ class _ForwardIterator,
+ class _RawPolicy = __remove_cvref_t<_ExecutionPolicy>,
+ enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI bool is_sorted(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {
----------------
H-G-Hristov wrote:
```suggestion
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool is_sorted(_ExecutionPolicy&& __policy, _ForwardIterator __first, _ForwardIterator __last) {
```
We've been implementing `[[nodiscard]]` in the library. These look like candidates to be annotated. Tests are added here (sorted) https://github.com/llvm/llvm-project/blob/main/libcxx/test/libcxx/algorithms/pstl.nodiscard.verify.cpp
https://github.com/llvm/llvm-project/pull/176129
More information about the libcxx-commits
mailing list