template<class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
swap_ranges(ExecutionPolicy&& exec,
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2);
Requires:
The two ranges
[first1, last1)
and
[first2, first2 + (last1 - first1))
shall not overlap
. Effects:
For each non-negative integer
n < (last1 - first1)
performs:
swap(*(first1 + n), *(first2 + n)). Returns:
first2 + (last1 - first1). Complexity:
Exactly
last1 - first1
swaps
. template<class ForwardIterator1, class ForwardIterator2>
void iter_swap(ForwardIterator1 a, ForwardIterator2 b);
Requires:
a and
b shall be dereferenceable
. Effects:
As if by
swap(*a, *b).