For a class in a namespace the proper way to provide swap()
is to define a free function in that namespace (e.g. How to overload std::swap()). But what is the best practice for a class that's in the global namespace?
cppreference has an example with a free swap()
function in the global namespace.
But this is the only place I've seen that done and I worry this was just an oversight.