This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Tentatively Ready status.

### 3670. Cpp17InputIterators don't have integer-class difference types

Section: 24.6.4.3 [range.iota.iterator] Status: Tentatively Ready Submitter: Casey Carter Opened: 2022-02-04 Last modified: 2022-02-09

Priority: Not Prioritized

View all other issues in [range.iota.iterator].

View all issues with Tentatively Ready status.

Discussion:

24.6.4.3 [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.

[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 24.6.4.3 [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);
>    >         […]
>    >       };
>    >     }

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

[2022-03-04; Reflector poll]

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

Proposed resolution:

This wording is relative to N4901.

1. Modify 24.6.4.3 [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);
   >         […]
   >       };
   >     }