Created on 2023-06-30.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4950.
Modify [common.iterator], class template common_iterator synopsis, as indicated:
namespace std { template<input_or_output_iterator I, sentinel_for<I> S> requires (!same_as<I, S> && copyable<I>) class common_iterator { public: […] friend constexpriter_rvalue_reference_t<I>decltype(auto) iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval<const I&>()))) requires input_iterator<I>; […] }; […] }
Modify [common.iter.cust] as indicated:
friend constexpriter_rvalue_reference_t<I>decltype(auto) iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval<const I&>()))) requires input_iterator<I>;-1- Preconditions: […]
-2- Effects: Equivalent to: return ranges::iter_move(get<I>(i.v_));
Modify [counted.iterator], class template counted_iterator synopsis, as indicated:
namespace std { template<input_or_output_iterator I> class counted_iterator { public: […] friend constexpriter_rvalue_reference_t<I>decltype(auto) iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) requires input_iterator<I>; […] }; […] }
Modify [counted.iter.cust] as indicated:
friend constexpriter_rvalue_reference_t<I>decltype(auto) iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) requires input_iterator<I>;-1- Preconditions: […]
-2- Effects: Equivalent to: return ranges::iter_move(i.current);
[ 2023-11-11 Approved at November 2023 meeting in Kona. Status changed: Voting → WP. ]
[ 2023-10-27; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
Although the customized iter_move of both requires the underlying iterator I to be input_iterator, they still explicitly specify the return type as iter_rvalue_reference_t<I>, which makes it always instantiated.
From the point of view that its validity is only specified in the input_iterator concept, it would be better to remove such unnecessary type instantiation, which does not make much sense for an output_iterator even if it is still valid.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-13 14:08:10 | admin | set | messages: + msg13847 |
2023-11-13 14:08:10 | admin | set | status: voting -> wp |
2023-11-07 21:41:54 | admin | set | status: ready -> voting |
2023-10-27 21:22:44 | admin | set | messages: + msg13766 |
2023-10-27 21:22:44 | admin | set | status: new -> ready |
2023-07-02 10:03:39 | admin | set | messages: + msg13676 |
2023-06-30 00:00:00 | admin | create |