Next : , Previous : Copy, Top : Table of  Contents


Swap

swap (T& a, T& b) Function

template  void swap(T& a, T& b);

swap exchanges values stored in two locations.

iter_swap (ForwardIterator1 a, ForwardIterator2 b) Function

template void iter_swap(ForwardIterator1 a, ForwardIterator2 b);

iter_swap exchanges values pointed by the two iterators a and b.

ForwardIterator2 swap_ranges (ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2) Function

template 


ForwardIterator2 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1,
                             ForwardIterator2 first2);
For each non-negative integer n < (last1 - first1) the swap is performed: swap(*(first1 + n), *(first2 + n)). swap_ranges returns first2 + (last1 - first1). Exactly last1 - first1 swaps are done. The result of swap_ranges is undefined if the two ranges [first1, last1) and [first2, first2 + (last1 - first1)) overlap.

 

Top