
Michael Marcin wrote:
I remember reading or hearing a long time ago that in C++0x it is an error to call std::swap(x,y) directly and you have to do using std::swap; swap(x,y);.
Curiously, last year I worried about getting a C++0x error from doing just that: "using std::swap; swap(x,y);"! Especially when one would use the C++0x std::Swappable concept. Douglas Gregor dedicated a blog entry to the issue: http://conceptgcc.wordpress.com/2007/01/02/revisiting-name-lookup-with-the-s...
This seems very unfortunate especially since boost can get us ADL swap without that in C++03. Does anyone know if this is still true?
I really don't know. I /think/ that the current version of the boost::swap utility should work in C++0x as well, at least in C++0x code that doesn't have concept checking. Of course, boost::swap doesn't yet support an rvalue as argument, like C++0x's std::swap will. But other than that, I think it should work fine. Please let me know if I'm wrong! Good night, Niels