
I'm pretty sure the intent of the code is to replace the generic swap-by-copy-assignment std::swap template
The intent is to replace std::swap with a call a specialized swap (via ADL) or to call boost::detail::move_swap::swap otherwise. std::swap will never be called from that function, unless std::swap is picked up by ADL - in which case it probably *is* specialized for the type being swapped. By making boost::detail::move_swap::swap less specialized than std::swap, you can stop the ambiguity that happens only in this case. For example, in your test case where you are swapping a std::vector you actually want std::swap to be called, as it is the specialized version (the standard defines the effect of template <class T, class Alloc> std::swap(std::vector<T,Alloc>& x, std::vector<T,Alloc>& y); to be x.swap(y)). For clarity; It's boost::detail::move_swap::swap that needs changing to have two tempalte parameters. Joe.