Sometimes classes are referencing other classes. Implementing std::swap() for such classes cannot be straightforward, because it would lead to swapping of origi
Essentially what you would like to do, if I understand your example, is to rebind references. This you cannot do in C++. You can either swap the values in the referred to objects, or you can use pointers.