I can't see why empty() needs a forward_iterator. It looks overconstrained and input_iterator should suffice because it is equivalent to the begin/end iterator comparison, yet, somehow this does not compile: auto is = std::istringstream{"1 2 3"}; auto v = ranges::istream_view<int>(is); { auto is_empty = v.empty(); // error } { auto [begin, end] = std::subrange(v); auto is_empty = begin == end; // works }
Because istream_view is a single pass range, once you call its begin(), it will change the internal state.
I understand. Thank you for clarification
(In reply to Pawel P from comment #2) > I understand. Thank you for clarification You should close with RESOLVED INVALID since there is nothing to fix.