blob: 9dcb764c60f8ecbc4561ad480c9ee2786306a86d [file] [log] [blame]
Brian Silverman598d0292018-08-04 23:56:47 -07001[/
2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5/]
6[section:swap_ranges swap_ranges]
7
8[heading Prototype]
9
10``
11template<class SinglePassRange1, class SinglePassRange2>
12SinglePassRange2& swap_ranges(SinglePassRange1& rng1, SinglePassRange& rng2);
13``
14
15[heading Description]
16
17`swap_ranges` swaps each element `x` in `rng1` with the corresponding element `y` in `rng2`.
18Returns a reference to `rng2`.
19
20[heading Definition]
21
22Defined in the header file `boost/range/algorithm/swap_ranges.hpp`
23
24[heading Requirements]
25
26* `SinglePassRange1` is a model of the __single_pass_range__ Concept.
27* `SinglePassRange1` is mutable.
28* `SinglePassRange2` is a model of the __single_pass_range__ Concept.
29* `SinglePassRange2` is mutable.
30
31[heading Complexity]
32
33Linear. Exactly `distance(rng1)` elements are swapped.
34
35[endsect]
36
37