swap_ranges function template — Swaps all values in two ranges
template<typename FwdIter1, typename FwdIter2>
FwdIter2 swap_ranges(FwdIter1 first1, FwdIter1 last1, FwdIter2 first2);
The swap_ranges
function
template swaps all the elements in [first1
, last1
) with corresponding elements in the
range that starts at first2
(and
has the same length as the first range). The return value is one
past the end of the second range. The two ranges must not
overlap.