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

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

Priority: 1

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

View all issues with C++20 status.


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 [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
        using iterator_categoryiterator_concept = input_iterator_tag;
        using difference_type = ptrdiff_t;
        using value_type = Val;
        iterator() = default;