cpp/algorithm/swap

Exchanges the given values.

@1@ Swaps the values and.

@2@ Swaps the arrays and. In effect calls.

Return value
(none)

Exceptions
@1@ @2@

Complexity
@1@ Constant

@2@ Linear in

Specializations
The expected way to make a program-defined type swappable is to provide a non-member function swap in the same namespace as the type: see for details.

The following overloads are already provided by the standard library: