
Joseph Gauterin wrote:
I have now uploaded the files the boost sandbox.
So you *do* have SVN write access by now :-)
The C++ Standard does not allow you to add your own overload of swap to the std namespace... I've corrected it in the checked in version - thanks for noticing.
You're welcome. A small remark about sandbox/swap/libs/utility/swap.html. It says: "The alternative to using argument dependent lookup in this situation is to provide a template specialization of std::swap for every type that requires a specialized swap. Although this is legal C++, no boost libraries use this method." Please note that you cannot add a partial template specialization of std::swap. So for instance, boost::shared_ptr<T> cannot have a generic template specialization of std::swap. namespace std { // This is NOT legal C++!!! template <typename T> void swap<boost::shared_ptr<T> >( boost::shared_ptr<T> & a, boost::shared_ptr<T> & b) { a.swap(b); } } This probably explains why boost libraries don't do it like that... BTW, I think it would be nice to add a literature reference to the doc. I would suggest adding a reference to Scott Meyers, Effective C++ Third Edition, Item 25: Consider support for a non-throwing swap. Kind regards, Niels