Since iter_reference_t<transform_view::iterator> can be a type that is not an lvalue-reference, the current wording on its iterator_category needs to be fixed.
Proposed Resolution
Change [range.transform.iterator] p2 as follows:
+ \tcode{iterator::iterator_category} is defined as follows:
— Let `C` denote the type `iterator_traits<iterator_t<Base>>::iterator_category`.
+ — If `is_lvalue_reference_v<iter_reference_t<iterator_t<Base>>>` is `true`,
— If `C` models `derived_from<contiguous_iterator_tag>`,
then `iterator_category` denotes `random_access_iterator_tag`.
— Otherwise, `iterator_category` denotes `C`.
+ — Otherwise, `iterator_category` denotes `input_iterator_tag`.
Making iterator_category unconditionally input_iterator_tag would be the safest fix, but I think the above fix works fine.
(I'm planning to submit this to LWG in a few days.)
Since
iter_reference_t<transform_view::iterator>can be a type that is not an lvalue-reference, the current wording on itsiterator_categoryneeds to be fixed.Proposed Resolution
Change [range.transform.iterator] p2 as follows:
Making
iterator_categoryunconditionallyinput_iterator_tagwould be the safest fix, but I think the above fix works fine.(I'm planning to submit this to LWG in a few days.)