[PATCH] libstdc++: Make sure iterator_traits<ranges::istream_view::iterator> is populated

Jonathan Wakely jwakely@redhat.com
Mon Feb 10 08:48:00 GMT 2020


On 07/02/20 13:59 -0500, Patrick Palka wrote:
>Since basic_istream_view::iterator is neither a cpp17 iterator (because it's
>move-only) nor does it define all four of the types {difference_type,
>value_type, reference, iterator_category}, then by the rule in
>[iterator.traits], its iterator_traits has no members.
>
>More concretely this means that it can't e.g. be composed with a
>views::transform or a views::filter because they look at the iterator_traits of
>the underlying view.
>
>This seems to be a defect in the current spec.

Agreed, but Casey Carter doesn't think this fix is correct, as it
would make this iterator appear to be a Cpp17InputIterator, which is
unwanted.

Please don't make this change, we should wait for guidance from LWG.



More information about the Libstdc++ mailing list