libstdc++: Use std::move for iterator in ranges::fill [PR117094]
commit03623fa91ff36ecb9faa3b55f7842a39b759594e
authorJonathan Wakely <jwakely@redhat.com>
Sun, 13 Oct 2024 21:48:43 +0000 (13 22:48 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 14 Oct 2024 09:55:50 +0000 (14 10:55 +0100)
tree061355f4468d8f7ed2337a42c4f81ae87e12a7f6
parentd8ef4471cb9c9f86784b62424a215ea42173bfe1
libstdc++: Use std::move for iterator in ranges::fill [PR117094]

Input iterators aren't required to be copyable.

libstdc++-v3/ChangeLog:

PR libstdc++/117094
* include/bits/ranges_algobase.h (__fill_fn): Use std::move for
iterator that might not be copyable.
* testsuite/25_algorithms/fill/constrained.cc: Check
non-copyable iterator with sized sentinel.
libstdc++-v3/include/bits/ranges_algobase.h
libstdc++-v3/testsuite/25_algorithms/fill/constrained.cc