real: move the swap function from std to the class namespace, as inline friend.

This is the idiomatic modern way of providing a user-defined swap.