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

3397. ranges::basic_istream_view::iterator should not provide iterator_category

Section: 26.6.6.3 [range.istream.iterator] Status: C++20 Submitter: Tomasz Kamiński Opened: 2020-02-13 Last modified: 2021-02-25

Priority: 1

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

View all issues with C++20 status.

Discussion:

The ranges::basic_istream_view::iterator is a move-only type, and as such it does not meets the Cpp17 iterator requirements, yet it does provides iterator_category (intended to be used for Cpp17 iterators). We should provide iterator_concept instead.

[2020-02 Status to Immediate on Thursday night in Prague.]

Proposed resolution:

This wording is relative to N4849.

  1. Modify 26.6.6.3 [range.istream.iterator] as indicated:

    namespace std::ranges {
      template<class Val, class CharT, class Traits>
      class basic_istream_view<Val, CharT, Traits>::iterator { // exposition only
      public:
        using iterator_categoryiterator_concept = input_iterator_tag;
        using difference_type = ptrdiff_t;
        using value_type = Val;
    
        iterator() = default;
        […]
      };
    }