
Thorsten Ottosen wrote:
please update documentation with the header I need to include
I agree, and I do think the documentation at libs/utility/swap.html could be further improved by adding a little example. E.g., #include <boost/swap.hpp> template <typename T> void do_some_generic_work(T& arg1, T& arg2) { // .... boost::swap(arg1, arg2); // .... } IMO such a simple example would suggest the proper use of boost::swap. The utility is especially useful within a generic context. But it's not recommended to do an unqualified call to boost::swap: std::string a1[42]; std::string a2[42]; boost::swap(a1, a2); // Okay. using boost::swap; swap(a1, a2); // Does not compile! It's also not recommended to explicitly specify the template arguments passed to boost::swap. The fact that boost::swap has two template arguments, instead of one, should be considered an implementation detail. (Both arguments must be of the same type anyway.) Just my 2 cents, Niels -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center -- Niels Dekker http://www.xs4all.nl/~nd/dekkerware Scientific programmer at LKEB, Leiden University Medical Center