[libcxx-commits] [PATCH] D155025: [libc++][PSTL] Implement std::rotate_copy

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 16 09:06:24 PDT 2023


ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/__algorithm/pstl_backend.h:158
+  template <class _ExecutionPolicy, class _Iterator, class _OutIterator>
+  void __pstl_rotate_copy(_Backend, _Iterator __first, _Iterator __middle, _Iterator __last, _OutIterator __result);
+
----------------
Return type needs to be updated


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/pstl.exception_handling.pass.cpp:26
+#ifndef TEST_HAS_NO_EXCEPTIONS
+bool operator==(ThrowOnCompare, ThrowOnCompare) { throw int{}; }
+#endif
----------------
boilerplate


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/pstl.rotate_copy.pass.cpp:35
+  void operator()(Policy&& policy) {
+    { // simple test
+      int in[] = {1, 2, 3, 4};
----------------
Could you add a test that validates that we didn't make any changes to the original range?


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.rotate/pstl.rotate_copy.pass.cpp:66
+    }
+    { // rotating an two-element range works
+      int in[] = {1, 2};
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155025/new/

https://reviews.llvm.org/D155025



More information about the libcxx-commits mailing list