Proposed resolution:
This wording is relative to N4910.
Modify [reverse.iter.elem] as indicated:
constexpr pointer operator->() const requires (is_pointer_v<Iterator> || requires(constIterator i) { i.operator->(); });-2- Effects:
(2.1) — If Iterator is a pointer type, equivalent to: return prev(current);
(2.2) — Otherwise, equivalent to: return prev(current).operator->();
Modify [common.iter.access] as indicated:
constexpr decltype(auto) operator->() const requires see below;-3- The expression in the requires-clause is equivalent to:
indirectly_readable<const I> && (requires(constI&i) { i.operator->(); } || is_reference_v<iter_reference_t<I>> || constructible_from<iter_value_t<I>, iter_reference_t<I>>)-4- Preconditions: holds_alternative<I>(v_) is true.
-5- Effects:
(5.1) — If I is a pointer type or if
the expression get<I>(v_).operator->() is well-formedrequires(I i) { i.operator->(); } is true, equivalent to: return get<I>(v_);(5.2) — Otherwise, if iter_reference_t<I> is a reference type, equivalent to:
auto&& tmp = *get<I>(v_); return addressof(tmp);(5.3) — Otherwise, equivalent to: return proxy(*get<I>(v_)); where proxy is the exposition-only class:
class proxy { iter_value_t<I> keep_; constexpr proxy(iter_reference_t<I>&& x) : keep_(std::move(x)) {} public: constexpr const iter_value_t<I>* operator->() const noexcept { return addressof(keep_); } };[…]