Created on 2019-09-13.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4835.
Modify [move.iter.nonmember] as indicated:
template<class Iterator> constexpr move_iterator<Iterator> operator+(iter_difference_t<Iterator> n, const move_iterator<Iterator>& x);-2- Constraints: x.base() + n is well-formed and has type Iterator.
-3- Returns: x + n.
[ 2021-10-14 Approved at October 2021 virtual plenary. Status changed: Voting → WP. ]
[ 2021-06-23; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
[ 2019-11-04; Casey comments and provides revised wording ]
After applying the P/R the Constraint element requires x + n to be well-formed (it always is, since that operation is unconstrained) and requires x + n to have type move_iterator<Iterator> (which it always does). Consequently, this Constraint is always satisfied and it has no normative effect. The intent of the change in P0896R4 was that this operator be constrained to require addition on the base iterator to be well-formed and have type Iterator, which ensures that the other semantics of this operation are implementable.
[ 2019-10-31 Issue Prioritization ]
Priority to 3 after reflector discussion.
Previous resolution [SUPERSEDED]:This wording is relative to N4830.
Modify [move.iter.nonmember] as indicated:
template<class Iterator> constexpr move_iterator<Iterator> operator+(iter_difference_t<Iterator> n, const move_iterator<Iterator>& x);-2- Constraints: x + n is well-formed and has type move_iterator<Iterator>.
-3- Returns: x + n.
Section [move.iter.nonmember]/2-3 says:
template<class Iterator> constexpr move_iterator<Iterator> operator+(iter_difference_t<Iterator> n, const move_iterator<Iterator>& x);Constraints: x + n is well-formed and has type Iterator.
Returns: x + n.
However, the return type of this operator is move_iterator<Iterator>, so the expression x + n ought to have that type. Also, there is no operator+ that matches the constraints, so it effectively disables the addition.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-10-14 09:56:08 | admin | set | messages: + msg12114 |
2021-10-14 09:56:08 | admin | set | status: voting -> wp |
2021-09-29 12:57:28 | admin | set | status: ready -> voting |
2021-06-23 14:16:45 | admin | set | messages: + msg11953 |
2021-06-23 14:16:45 | admin | set | status: new -> ready |
2019-11-04 20:10:00 | admin | set | messages: + msg10742 |
2019-10-31 18:46:30 | admin | set | messages: + msg10711 |
2019-09-18 18:35:39 | admin | set | messages: + msg10657 |
2019-09-13 00:00:00 | admin | create |