30 Jul
2013
30 Jul
'13
7:51 a.m.
On Mon, 29 Jul 2013, Joseph Gauterin wrote:
Given a user define types that specializes std::swap but isn't moveable (a reasonable scenario for C++03 code still being compiled with a C++03 compiler), wouldn't this change result in 3 copies instead of a single call to the specialized std:swap?
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... -- Marc Glisse