diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-02-27 13:27:17 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-02-28 21:35:27 +0000 |
commit | 3866ca796d5281d33f25b4165badacf8f198c6d1 (patch) | |
tree | f258fc80ee51dece3bc84c559d300d42c63ce9c8 /gcc | |
parent | a9cfcd0d9e3780c71442057f636f62a7142056cb (diff) | |
download | gcc-3866ca796d5281d33f25b4165badacf8f198c6d1.zip gcc-3866ca796d5281d33f25b4165badacf8f198c6d1.tar.gz gcc-3866ca796d5281d33f25b4165badacf8f198c6d1.tar.bz2 |
libstdc++: Fix ranges::move and ranges::move_backward to use iter_move [PR105609]
The ranges::move and ranges::move_backward algorithms are supposed to
use ranges::iter_move(iter) instead of std::move(*iter), which matters
for an iterator type with an iter_move overload findable by ADL.
Currently those algorithms use std::__assign_one which uses std::move,
so define a new ranges::__detail::__assign_one helper function that uses
ranges::iter_move.
libstdc++-v3/ChangeLog:
PR libstdc++/105609
* include/bits/ranges_algobase.h (__detail::__assign_one): New
helper function.
(__copy_or_move, __copy_or_move_backward): Use new function
instead of std::__assign_one.
* testsuite/25_algorithms/move/constrained.cc: Check that
ADL iter_move is used in preference to std::move.
* testsuite/25_algorithms/move_backward/constrained.cc:
Likewise.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions