swap [C++ Reference]
Keywords: stl,algorithm,swap
Date: 2008-10-14T15:42:06-0700

[[swap]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## swap

Syntax:

        #include <algorithm>
        void swap( Assignable& a, Assignable& b );

The swap() function swaps the values of a and b. swap() expects that its arguments will conform to the Assignable model; that is, they should have a copy constructor and work with the = operator. This function performs one copy and two assignments.

Related Topics: copy, copy_backward, copy_n, iter_swap, swap_ranges

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •