This sample is licensed under the CC0 Public Domain Dedication.
Swap the values of two objects.
On line 9, we use a using-declaration
std::swap visible and then, on line 10, we call unqualified
std::swap) to swap the values of the two objects.
This allows a user-defined specialization of
swap to be found
via argument-dependent lookup (ADL), which may
provide a more efficient implementation of the swap operation,
before falling back to the generic
std::swap function. This
approach is particularly useful when swapping two generic
objects (such as in a template).