It makes more sense to use template specialization for std::swap
class MyClass {
public:
void Swap(MyClass &) ;
};
namespace std {
template<> swap
a.Swap(b);
}
}
so that way we just tune the default swap to use our class specific Swap and things become fast and simple for us .