Title
Cpp17InputIterators don't have integer-class difference types
Status
ready
Section
[range.iota.iterator]
Submitter
Casey Carter

Created on 2022-02-04.00:00:00 last changed 2 months ago

Messages

Date: 2022-03-04.14:33:21

Proposed resolution:

This wording is relative to N4901.

  1. Modify [range.iota.iterator], class iota_view::iterator synopsis, as indicated:

    namespace std::ranges {
      template<weakly_incrementable W, semiregular Bound>
        requires weakly-equality-comparable-with<W, Bound> && copyable<W>
      struct iota_view<W, Bound>::iterator {
        […]
        using iterator_category = input_iterator_tag; // present only if W models incrementable and 
                                                      // IOTA-DIFF-T(W) is an integral type
        using value_type = W;
        using difference_type = IOTA-DIFF-T(W);
        […]
      };
    }
    
Date: 2022-03-15.00:00:00

[ 2022-03-04; Reflector poll ]

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

Date: 2022-02-15.00:00:00

[ 2022-02-07; Casey Carter provides improved wording ]

Date: 2022-02-15.00:00:00

[ 2022-02-07; Daniel comments ]

As requested by LWG 3376 and wording implemented by P2393R1, integer-class types are no longer required to have class type.

Previous resolution [SUPERSEDED]:

This wording is relative to N4901.

  1. Modify [range.iota.iterator], class iota_view::iterator synopsis, as indicated:

    namespace std::ranges {
      template<weakly_incrementable W, semiregular Bound>
        requires weakly-equality-comparable-with<W, Bound> && copyable<W>
      struct iota_view<W, Bound>::iterator {
        […]
        using iterator_category = input_iterator_tag; // present only if W models incrementable and 
                                                      // IOTA-DIFF-T(W) is not a class type
        using value_type = W;
        using difference_type = IOTA-DIFF-T(W);
        […]
      };
    }
    
Date: 2022-02-04.00:00:00

[range.iota.iterator] defines

using iterator_category = input_iterator_tag; // present only if W models incrementable

but when difference_type is an integer-class type the iterator does not meet the Cpp17InputIterator requirements.

History
Date User Action Args
2022-03-04 14:33:21adminsetmessages: + msg12389
2022-03-04 14:33:21adminsetstatus: new -> ready
2022-02-09 16:48:41adminsetmessages: + msg12344
2022-02-07 18:25:59adminsetmessages: + msg12343
2022-02-06 18:48:50adminsetmessages: + msg12342
2022-02-04 00:00:00admincreate