Top of document
©Copyright 1999 Rogue Wave Software

swap


     Algorithm

Summary

Exchange values.

Contents

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


Top of document