[gcc(refs/users/ppalka/heads/libstdcxx-constrained-algos)] Adjust overzealous std::move

Patrick Palka ppalka@gcc.gnu.org
Fri Jan 24 20:59:00 GMT 2020


https://gcc.gnu.org/g:ae96fee86ba17ae29da2ec74ed203d1df3f216f1

commit ae96fee86ba17ae29da2ec74ed203d1df3f216f1
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jan 24 15:57:12 2020 -0500

    Adjust overzealous std::move

Diff:
---
 libstdc++-v3/include/bits/ranges_algo.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/bits/ranges_algo.h b/libstdc++-v3/include/bits/ranges_algo.h
index 7865907..f1de85f 100644
--- a/libstdc++-v3/include/bits/ranges_algo.h
+++ b/libstdc++-v3/include/bits/ranges_algo.h
@@ -2385,15 +2385,15 @@ namespace ranges
     {
       // TODO: is it worth reimplementing std::stable_partition here?
       auto __lasti = ranges::next(__first, __last);
-      auto __proj_comp = [&] (auto&& __arg) {
+      auto __proj_pred = [&] (auto&& __arg) {
 	using _Tp = decltype(__arg);
 	return std::__invoke(__pred,
 			     std::__invoke(__proj, std::forward<_Tp>(__arg)));
       };
       auto __middle = std::stable_partition(std::move(__first),
-					    std::move(__lasti),
-					    std::move(__proj_comp));
-      return {__middle, __lasti};
+					    __lasti,
+					    std::move(__proj_pred));
+      return {std::move(__middle), std::move(__lasti)};
     }
 
   template<bidirectional_range _Range, typename _Proj = identity,



More information about the Libstdc++-cvs mailing list