There is nothing wrong with that code. The comment is strange, but the code is fine. 'swap' function call has to be resolved via ADL and this is how it's done correctly. It's unfortunate that the C++ Standard essentially requires swap to be called this way (i.e.: using std::swap; swap(a, b);). In your code it's best factored out into a separate 'swap_helper' function and this is what's done there.
C++ is convoluted. Sometimes code that seems quite wrong has a good reason to exist.
C++ is convoluted. Sometimes code that seems quite wrong has a good reason to exist.