on Tue Jul 30 2013, Joseph Gauterin
The recommended way is to overload swap for your type, not specialize std::swap. As long as that case still works, the rest might be acceptable...
At the time boost::swap was created, my motivating use case involved use of multiple 3rd party libraries. Some provided swap through ADL, others by specialising std::swap. Both techniques are legal and there's no clear technical advantage to either
That's not true. Specializing has at least two serious technical disadvantages: 1. Doesn't work for templates because you can't partially specialize functions 2. Interacts badly with overloads: overload resolution doesn't consider specializations; they're merely implementation substitutions that are made *after* the overload to call has been selected. -- Dave Abrahams