Title
common_iterator is not sufficiently constrained for non-copyable iterators
Status
c++20
Section
[common.iterator]
Submitter
Corentin Jabot

Created on 2020-01-31.00:00:00 last changed 45 months ago

Messages

Date: 2020-02-10.19:13:13

Proposed resolution:

This wording is relative to N4849.

  1. Modify [iterator.synopsis], header <iterator> synopsis, as indicated:

    namespace std {
      […]
      // [iterators.common], common iterators
      template<input_or_output_iterator I, sentinel_for<I> S>
        requires (!same_as<I, S> && copyable<I>)
          class common_iterator;
      […]
    }
    
  2. Modify [common.iterator], class template common_iterator synopsis, as indicated:

    namespace std {
      template<input_or_output_iterator I, sentinel_for<I> S>
        requires (!same_as<I, S> && copyable<I>)
      class common_iterator {
      public:
        […]
      };
      […]
    }
    
Date: 2020-02-10.19:13:13

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

Date: 2020-01-31.00:00:00

We don't actually specify anywhere that non-copyable iterators do not have a common_iterator (and it would make little sense for them to as algorithms dealing with C++17 iterators are not expecting non-copyable things) As it stands common_iterator can be created from move only iterator but are then non-copyable themselves. P1862 already constrains common_view in a similar fashion

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: + msg11020
2020-02-10 19:13:13adminsetstatus: new -> immediate
2020-02-01 16:45:21adminsetmessages: + msg10982
2020-01-31 00:00:00admincreate