aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__algorithm/copy.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-08-13 15:37:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:04:56 +0000
commit61cfbce3347e4372143bcabf7b197577b9f3958a (patch)
treea996b7140fcecf4ec110b2ac28983b858e5df637 /contrib/llvm-project/libcxx/include/__algorithm/copy.h
parent972a253a57b6f144b0e4a3e2080a2a0076ec55a0 (diff)
parent677727e8296a802385345db6fa65e68223f4597a (diff)
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/copy.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__algorithm/copy.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/copy.h b/contrib/llvm-project/libcxx/include/__algorithm/copy.h
index 5428baa68859..f7535a81547a 100644
--- a/contrib/llvm-project/libcxx/include/__algorithm/copy.h
+++ b/contrib/llvm-project/libcxx/include/__algorithm/copy.h
@@ -10,6 +10,7 @@
#define _LIBCPP___ALGORITHM_COPY_H
#include <__algorithm/unwrap_iter.h>
+#include <__algorithm/unwrap_range.h>
#include <__config>
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
@@ -88,10 +89,11 @@ template <class _InIter, class _Sent, class _OutIter,
&& is_copy_constructible<_Sent>::value
&& is_copy_constructible<_OutIter>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
-pair<_InIter, _OutIter>
-__copy(_InIter __first, _Sent __last, _OutIter __result) {
- auto __ret = std::__copy_impl(std::__unwrap_iter(__first), std::__unwrap_iter(__last), std::__unwrap_iter(__result));
- return std::make_pair(std::__rewrap_iter(__first, __ret.first), std::__rewrap_iter(__result, __ret.second));
+pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result) {
+ auto __range = std::__unwrap_range(__first, __last);
+ auto __ret = std::__copy_impl(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__result));
+ return std::make_pair(
+ std::__rewrap_range<_Sent>(__first, __ret.first), std::__rewrap_iter(__result, __ret.second));
}
template <class _InputIterator, class _OutputIterator>