You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template<movable Val, class CharT, class Traits = char_traits<CharT>>
class basic_istream_view : public view_interface<basic_istream_view<Val, CharT, Traits>> {
public:
constexpr auto begin() {
*stream_ >> value_;
return iterator{*this};
}
constexpr default_sentinel_t end() const noexcept;
};
Even if begin() is non-const-qualified, since end() simply returns default_sentinel, it is still designed to be const-qualified member function, which allows us to call as_const(r).end() even if as_const(r) is not a range.
template<view V>
class chunk_view : public view_interface<chunk_view<V>> {
public:
constexpr outer-iterator begin();
constexpr default_sentinel_t end() noexcept;
};
Even though end() can be const-qualified, it is still designed to be non-const-qualified, which makes end()'s const-qualification consistent with begin()'s and prevents us from calling as_const(r).end().
Do we need to resolve this inconsistency?
The text was updated successfully, but these errors were encountered:
FWIW I think we did just make that change during the review of generator but I agree it would be non-editorial to change anything already in the working draft.
FWIW I think we did just make that change during the review of generator but I agree it would be non-editorial to change anything already in the working draft.
Thanks for your information.
So did the generator finally drop the const of end? What were the decision of the committee and the consideration behind it? It would be great to know.
The
begin
/end
ofbasic_istream_view
is defined in [range.istream.view]Even if
begin()
is non-const
-qualified, sinceend()
simply returnsdefault_sentinel
, it is still designed to beconst
-qualified member function, which allows us to callas_const(r).end()
even ifas_const(r)
is not arange
.However, the
begin
/end
ofchunk_view
for input ranges is defined in [range.chunk.view.input] asEven though
end()
can beconst
-qualified, it is still designed to be non-const
-qualified, which makesend()
'sconst
-qualification consistent withbegin()
's and prevents us from callingas_const(r).end()
.Do we need to resolve this inconsistency?
The text was updated successfully, but these errors were encountered: