Title
ranges::rotate_copy should use std::move
Status
c++23
Section
[alg.rotate]
Submitter
Hewill Kang

Created on 2022-08-25.00:00:00 last changed 5 months ago

Messages

Date: 2022-11-17.00:42:33

Proposed resolution:

This wording is relative to N4910.

  1. Modify [alg.rotate] as indicated:

    template<forward_range R, weakly_incrementable O>
      requires indirectly_copyable<iterator_t<R>, O>
      constexpr ranges::rotate_copy_result<borrowed_iterator_t<R>, O>
        ranges::rotate_copy(R&& r, iterator_t<R> middle, O result);
    

    -11- Effects: Equivalent to:

    return ranges::rotate_copy(ranges::begin(r), middle, ranges::end(r), std::move(result));
    

Date: 2022-11-12.00:00:00

[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP. ]

Date: 2022-09-15.00:00:00

[ 2022-09-23; Reflector poll ]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

Date: 2022-08-25.00:00:00

The range version of ranges::rotate_copy directly passes the result to the iterator-pair version. Since the type of result only models weakly_incrementable and may not be copied, we should use std::move here.

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-11-17 00:42:33adminsetmessages: + msg13066
2022-11-17 00:42:33adminsetstatus: voting -> wp
2022-11-08 03:46:49adminsetstatus: ready -> voting
2022-09-23 15:43:32adminsetmessages: + msg12786
2022-09-23 15:43:32adminsetstatus: new -> ready
2022-09-03 13:01:09adminsetmessages: + msg12726
2022-08-25 00:00:00admincreate