Standard C++ Library Class Reference
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
swap_ranges
 Algorithm
Summary
Exchange a range of values in one location with those in another
Contents
Synopsis● 
Description● 
Example● 
Warning● 
See Also● 
Synopsis
#include <algorithm>
template <class ForwardIterator1, class ForwardIterator2>
ForwardIterator2 swap_ranges (ForwardIterator1 first1,
 ForwardIterator1 last1,
 ForwardIterator2 first2);
Description
The swap_ranges algorithm exchanges corresponding values in two ranges, in the following
manner:
For each non-negative integer n < (last - first) the function exchanges *(first1 + n) with *(first2
+ n)). After completing all exchanges, swap_ranges returns an iterator that points to the end of
the second container, i.e., first2 + (last1 -first1). The result of swap_ranges is undefined if the










