Container Class::swap

Note

This topic is in the Microsoft C++ documentation as a nonfunctional example of containers used in the C++ Standard Library. For more information, see C++ Standard Library Containers.

Swaps the controlled sequences between *this and its argument.

Syntax

void swap(Container& right);

Remarks

If *this.get_allocator == right.get_allocator, it does a swap in constant time. Otherwise, it performs element assignments and constructor calls proportional to the number of elements in the two controlled sequences.

See also

Sample Container Class