[libcxx-commits] [libcxx] [libc++][pstl] Implement pstl std::min_element (PR #173970)
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Dec 30 10:40:08 PST 2025
================
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++17
+
+// UNSUPPORTED: libcpp-has-no-incomplete-pstl
+
+// <algorithm>
+
+// template<class ExecutionPolicy, class ForwardIterator>
+// [[nodiscard]] ForwardIterator min_element(ExecutionPolicy&& exec,
+// ForwardIterator first, ForwardIterator last);
+//
+// template<class ExecutionPolicy, class ForwardIterator, class Compare>
+// [[nodiscard]] ForwardIterator min_element(ExecutionPolicy&& exec,
+// ForwardIterator first, ForwardIterator last,
+// Compare comp);
+
+#include <algorithm>
+#include <execution>
+#include <functional>
+
+int main(int, char**) {
----------------
Zingam wrote:
```suggestion
void test {
```
`verify.cpp` tests don't need a `main()` function. `[[nodiscard]]` tests are libc++ specific and should be put in `tests/libcxx`, however we already have PSTL specific test located in `/libcxx/test/libcxx/diagnostics/pstl.nodiscard.verify.cpp` currently.
https://github.com/llvm/llvm-project/pull/173970
More information about the libcxx-commits
mailing list