aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.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/ranges_move_backward.h
parent972a253a57b6f144b0e4a3e2080a2a0076ec55a0 (diff)
parent677727e8296a802385345db6fa65e68223f4597a (diff)
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h b/contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
index b3dfa7139603..583a6bf29d51 100644
--- a/contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
+++ b/contrib/llvm-project/libcxx/include/__algorithm/ranges_move_backward.h
@@ -40,10 +40,11 @@ struct __fn {
template <class _InIter, class _Sent, class _OutIter>
_LIBCPP_HIDE_FROM_ABI constexpr static
move_backward_result<_InIter, _OutIter> __move_backward_impl(_InIter __first, _Sent __last, _OutIter __result) {
- auto __ret = ranges::move(std::make_reverse_iterator(ranges::next(__first, __last)),
+ auto __last_iter = ranges::next(__first, std::move(__last));
+ auto __ret = ranges::move(std::make_reverse_iterator(__last_iter),
std::make_reverse_iterator(__first),
std::make_reverse_iterator(__result));
- return {std::move(__ret.in.base()), std::move(__ret.out.base())};
+ return {std::move(__last_iter), std::move(__ret.out.base())};
}
template <bidirectional_iterator _InIter, sentinel_for<_InIter> _Sent, bidirectional_iterator _OutIter>