[libcxx-commits] [libcxx] [libc++][pstl] Implementation of parallel std::uninitialized_(copy|move)(_n) based on parallel __for_each (PR #223229)

Michael G. Kazakov via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 2 06:41:17 PDT 2026


================
@@ -82,6 +83,36 @@ uninitialized_default_construct_n(_ExecutionPolicy&& __policy, _ForwardIterator
   __pstl::__handle_exception<_Implementation>(std::forward<_ExecutionPolicy>(__policy), std::move(__first), __n);
 }
 
+template <class _ExecutionPolicy,
+          class _InputIterator,
+          class _ForwardIterator,
+          class _RawPolicy                                    = __remove_cvref_t<_ExecutionPolicy>,
+          enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
+_LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_copy(
+    _ExecutionPolicy&& __policy, _InputIterator __first, _InputIterator __last, _ForwardIterator __result) {
+  _LIBCPP_REQUIRE_CPP17_INPUT_ITERATOR(_InputIterator, "uninitialized_copy requires InputIterators");
----------------
mikekazakov wrote:

They were implemented as of C++17, without applying LWG3552, which was likely wrong...
I'll fix this within #104357.

https://github.com/llvm/llvm-project/pull/223229


More information about the libcxx-commits mailing list