[libcxx-commits] [PATCH] D143161: [libc++][PSTL] Implement std::{any, all, none}_of

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 26 16:44:07 PDT 2023


philnik created this revision.
philnik added a reviewer: ldionne.
Herald added a subscriber: miyuki.
Herald added a project: All.
philnik updated this revision to Diff 500797.
philnik added a comment.
philnik updated this revision to Diff 501212.
philnik updated this revision to Diff 501350.
philnik updated this revision to Diff 501352.
philnik updated this revision to Diff 501525.
philnik updated this revision to Diff 517299.
philnik marked 3 inline comments as done.
philnik updated this revision to Diff 517389.
philnik published this revision for review.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Try to fix CI


philnik added a comment.

Try to fix CI


philnik added a comment.

Try to fix CI


philnik added a comment.

Fix header guard


philnik added a comment.

Try to fix CI


philnik added a comment.

- Rebased
- Address comments


philnik added a comment.

Improve tests



================
Comment at: libcxx/include/__algorithm/any_of.h:1
 // -*- C++ -*-
 //===----------------------------------------------------------------------===//
----------------
I would suggest splitting the PSTL `all_of`, `any_of` and `none_of` into a separate header to avoid impacting the dependencies of the basic `any_of` algorithm.


================
Comment at: libcxx/include/execution:58
 
+// TODO: Do we want to make this a supported extension in C++17?
+struct __unsequenced_policy {
----------------
I would say no, as for most other extensions.


================
Comment at: libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/pstl.any_of.pass.cpp:28
+    // simple test
+    assert(std::any_of(policy, std::begin(a), std::end(a), [](int i) { return i < 9; }));
+    assert(!std::any_of(policy, std::begin(a), std::end(a), [](int i) { return i > 8; }));
----------------
Like other algorithms, this should be tested on the different iterator categories.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143161

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__algorithm/all_of.h
  libcxx/include/__algorithm/pstl_any_all_none_of.h
  libcxx/include/__pstl/internal/algorithm_fwd.h
  libcxx/include/__pstl/internal/algorithm_impl.h
  libcxx/include/__pstl/internal/glue_algorithm_defs.h
  libcxx/include/__pstl/internal/glue_algorithm_impl.h
  libcxx/include/__pstl/internal/parallel_backend_serial.h
  libcxx/include/__pstl/internal/parallel_impl.h
  libcxx/include/__pstl/internal/unseq_backend_simd.h
  libcxx/include/__pstl/internal/utils.h
  libcxx/include/__type_traits/is_execution_policy.h
  libcxx/include/__utility/terminate_on_exception.h
  libcxx/include/algorithm
  libcxx/include/execution
  libcxx/include/module.modulemap.in
  libcxx/test/libcxx/private_headers.verify.cpp
  libcxx/test/std/algorithms/alg.nonmodifying/alg.all_of/pstl.all_of.pass.cpp
  libcxx/test/std/algorithms/alg.nonmodifying/alg.any_of/pstl.any_of.pass.cpp
  libcxx/test/std/algorithms/alg.nonmodifying/alg.none_of/pstl.none_of.pass.cpp
  libcxx/test/support/test_execution_policies.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143161.517389.patch
Type: text/x-patch
Size: 33519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230426/5371810f/attachment-0001.bin>


More information about the libcxx-commits mailing list