Title
A move-only iterator still does not have a counted_iterator
Status
c++20
Section
[counted.iter.const]
Submitter
Patrick Palka

Created on 2020-02-07.00:00:00 last changed 38 months ago

Messages

Date: 2020-02-10.19:13:13

Proposed resolution:

This wording is relative to N4849.

  1. Modify [counted.iter.const] as indicated:

    constexpr counted_iterator(I i, iter_difference_t<I> n);
    

    -1- Preconditions: n >= 0.

    -2- Effects: Initializes current with std::move(i) and length with n.

Date: 2020-02-10.19:13:13

[ 2020-02 Prioritized as IMMEDIATE Monday morning in Prague ]

Date: 2020-02-08.14:52:11

P1207R4 ("Movability of single-pass iterators") introduces the notion of a move-only non-forward iterator and makes some changes to the iterator adaptor counted_iterator in order to support move-only iterators.

The problem is that the constructor of counted_iterator ([counted.iter.const] p2) accepting such an iterator is specified as "Initializes current with i" which would attempt copy-constructing current from i instead of move-constructing it.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-10 19:13:13adminsetmessages: + msg11024
2020-02-10 19:13:13adminsetstatus: new -> immediate
2020-02-08 14:25:02adminsetmessages: + msg10996
2020-02-07 00:00:00admincreate