Skip to content

Commit 61d5671

Browse files
committed
Revert "[libc++][PSTL] Implement std::copy{,_n}"
This reverts commit b049fc0. The wrong patch was landed.
1 parent c820f9e commit 61d5671

File tree

7 files changed

+44
-265
lines changed

7 files changed

+44
-265
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ set(files
7979
__algorithm/pstl_backends/cpu_backends/for_each.h
8080
__algorithm/pstl_backends/cpu_backends/serial.h
8181
__algorithm/pstl_backends/cpu_backends/transform.h
82-
__algorithm/pstl_copy.h
8382
__algorithm/pstl_fill.h
8483
__algorithm/pstl_find.h
8584
__algorithm/pstl_for_each.h

libcxx/include/__algorithm/pstl_copy.h

Lines changed: 0 additions & 57 deletions
This file was deleted.

libcxx/include/__pstl/internal/glue_algorithm_defs.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardItera
112112

113113
// [alg.copy]
114114

115+
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
116+
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
117+
copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result);
118+
119+
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2>
120+
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
121+
copy_n(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Size __n, _ForwardIterator2 __result);
122+
115123
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
116124
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
117125
copy_if(_ExecutionPolicy&& __exec,

libcxx/include/__pstl/internal/glue_algorithm_impl.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,42 @@ __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardItera
178178

179179
// [alg.copy]
180180

181+
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2>
182+
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
183+
copy(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result) {
184+
auto __dispatch_tag = __pstl::__internal::__select_backend(__exec, __first, __result);
185+
186+
using __is_vector = typename decltype(__dispatch_tag)::__is_vector;
187+
188+
return __pstl::__internal::__pattern_walk2_brick(
189+
__dispatch_tag,
190+
std::forward<_ExecutionPolicy>(__exec),
191+
__first,
192+
__last,
193+
__result,
194+
[](_ForwardIterator1 __begin, _ForwardIterator1 __end, _ForwardIterator2 __res) {
195+
return __pstl::__internal::__brick_copy(__begin, __end, __res, __is_vector{});
196+
});
197+
}
198+
199+
template <class _ExecutionPolicy, class _ForwardIterator1, class _Size, class _ForwardIterator2>
200+
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
201+
copy_n(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _Size __n, _ForwardIterator2 __result) {
202+
auto __dispatch_tag = __pstl::__internal::__select_backend(__exec, __first, __result);
203+
204+
using __is_vector = typename decltype(__dispatch_tag)::__is_vector;
205+
206+
return __pstl::__internal::__pattern_walk2_brick_n(
207+
__dispatch_tag,
208+
std::forward<_ExecutionPolicy>(__exec),
209+
__first,
210+
__n,
211+
__result,
212+
[](_ForwardIterator1 __begin, _Size __sz, _ForwardIterator2 __res) {
213+
return __pstl::__internal::__brick_copy_n(__begin, __sz, __res, __is_vector{});
214+
});
215+
}
216+
181217
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Predicate>
182218
__pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2>
183219
copy_if(_ExecutionPolicy&& __exec,

libcxx/include/algorithm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,6 @@ template <class BidirectionalIterator, class Compare>
17891789
#include <__algorithm/pop_heap.h>
17901790
#include <__algorithm/prev_permutation.h>
17911791
#include <__algorithm/pstl_any_all_none_of.h>
1792-
#include <__algorithm/pstl_copy.h>
17931792
#include <__algorithm/pstl_fill.h>
17941793
#include <__algorithm/pstl_find.h>
17951794
#include <__algorithm/pstl_for_each.h>

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/pstl.copy.pass.cpp

Lines changed: 0 additions & 104 deletions
This file was deleted.

libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/pstl.copy_n.pass.cpp

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)