## swap

    Algorithm

- Summary
- Data Type and Member Function Indexes
- Synopsis
- Description
- See Also

### Summary

Exchanges values.

### Data Type and Member Function Indexes
(exclusive of constructors and destructors)

None

### Synopsis

    #include <algorithm>
    template <class T>
    void swap (T& a, T& b);

### Description

The swap algorithm exchanges the values of `a` and `b`. The effect is:

    T tmp = a
    a = b
    b = tmp

### See Also

iter_swap, swap_ranges

Copyright (c) 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998