23 Iterators library [iterators]

23.3 Iterator requirements [iterator.requirements]

23.3.3 Customization points [iterator.cust]

23.3.3.2 ranges​::​iter_­swap [iterator.cust.swap]

The name ranges::iter_­swap denotes a customization point object ([customization.point.object]) that exchanges the values ([concept.swappable]) denoted by its arguments.
Let iter-exchange-move be the exposition-only function:
template<class X, class Y> constexpr iter_value_t<remove_reference_t<X>> iter-exchange-move(X&& x, Y&& y) noexcept(noexcept(iter_value_t<remove_reference_t<X>>(iter_move(x))) && noexcept(*x = iter_move(y)));
Effects: Equivalent to:
iter_value_t<remove_reference_t<X>> old_value(iter_move(x));
*x = iter_move(y);
return old_value;
The expression ranges::iter_­swap(E1, E2) for some subexpressions E1 and E2 is expression-equivalent to: