Created on 2019-09-10.00:00:00 last changed 62 months ago
Proposed resolution:
This wording is relative to N4830.
Modify [iterator.traits] as indicated:
-2- The definitions in this subclause make use of the following exposition-only concepts:
template<class I> concept cpp17-iterator = copyable<I> && requires(I i) { { *i } -> can-reference; { ++i } -> same_as<I&>; { *i++ } -> can-reference; }; template<class I> concept cpp17-input-iterator = cpp17-iterator<I> && equality_comparable<I> && requires(I i) { typename incrementable_traits<I>::difference_type; typename readable_traits<I>::value_type;typename common_reference_t<iter_reference_t<I>&&, typename readable_traits<I>::value_type&>; typename common_reference_t<decltype(*i++)&&, typename readable_traits<I>::value_type&>;{ *i } -> convertible_to<const typename readable_traits<I>::value_type&>; { *i++ } -> convertible_to<const typename readable_traits<I>::value_type&>; requires signed_integral<typename incrementable_traits<I>::difference_type>; }; […]
[ 2019-10-14 Issue Prioritization ]
Priority to 3 after reflector discussion.
The new C++20 iterator concepts use common_reference to constrain the value, reference, and rvalue_reference associated types in order to support proxy references (see [iterator.concept.readable]).
However, the C++17 iterators did not support proxy references, so the use of common_reference in [iterator.traits]/p2 is needlessly complex. The common_reference constraints can be replaced with simple convertibility requirements to a const lvalue reference to the value type. This fix has been implemented in range-v3.History | |||
---|---|---|---|
Date | User | Action | Args |
2019-10-14 17:22:27 | admin | set | messages: + msg10701 |
2019-09-17 17:00:52 | admin | set | messages: + msg10645 |
2019-09-10 00:00:00 | admin | create |