[iterator.cust.move] (original) (raw)
23 Iterators library [iterators]
23.3 Iterator requirements [iterator.requirements]
23.3.3 Customization points [iterator.cust]
23.3.3.1 ranges::iter_move [iterator.cust.move]
The expression ranges::iter_move(E) for a subexpression E is expression-equivalent to:
- iter_move(E), ifE has class or enumeration type anditer_move(E) is a well-formed expression when treated as an unevaluated operand, with overload resolution performed in a context that does not include a declaration of ranges::iter_movebut does include the declaration
void iter_move(); - Otherwise, if the expression *E is well-formed:
- if *E is an lvalue, std::move(*E);
- otherwise, *E.
- Otherwise, ranges::iter_move(E) is ill-formed.
[ Note
:
This case can result in substitution failure when ranges::iter_move(E)appears in the immediate context of a template instantiation.
— end note
]
If ranges::iter_move(E) is not equal to *E, the program is ill-formed, no diagnostic required.