Name

swap function template — Swaps the contents of two sets

Synopsis

template <typename Key, typename T, typename C, typename A>
 void swap(set<Key,T,C,A>& x,
           set<Key,T,C,A>& y);
template <typename Key, typename T, typename C, typename A>
 void swap(multiset<Key,T,C,A>& x,
           multiset<Key,T,C,A>& y);

The swap function template specialization is equivalent to calling x.swap(y).

See Also

swap in <algorithm>

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.