std::swap

From Cppreference

Jump to: navigation, search
Defined in header <algorithm>

template< class Assignable >
void swap( Assignable& a, Assignable& b );

Swaps the given values a and b.

Contents

Parameters

a, b - the values to be swapped

Return value

(none)

Example

Complexity

constant

See also

copy
copies some range of elements to a new location
(function template)
iter_swap
swaps the elements pointed to by two iterators
(function template)
swap_ranges
swaps two ranges of elements
(function template)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages