Index: tuple.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/tuple/tuple.hpp,v retrieving revision 1.7 diff -c -r1.7 tuple.hpp *** tuple.hpp 27 Jul 2004 03:43:32 -0000 1.7 --- tuple.hpp 30 Mar 2006 20:19:01 -0000 *************** *** 87,90 **** --- 87,144 ---- } // end namespace boost + // Swap + namespace boost { namespace tuples { namespace detail { + + #if defined(__GNUC__) + + template + inline void swap_tuples(Type const& left, Type const& right) + { + using std::swap; + swap(const_cast(left).get_head(), + const_cast(right).get_head()); + swap_tuples(left.get_tail(), right.get_tail()); + } + + template<> + inline void swap_tuples(null_type const&, null_type const&) + { + } + + #else // defined(__GNUC__) + + template + inline void swap_tuples(Type& left, Type& right) + { + using std::swap; + swap(left.get_head(), right.get_head()); + swap_tuples(left.get_tail(), right.get_tail()); + } + + template<> + inline void swap_tuples(null_type&, null_type&) + { + } + + #endif + + } } } // namespace boost::tuples::detail + + #if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) + + namespace boost { namespace tuples { + + template + inline void swap(tuple& left, + tuple& right) + { + detail::swap_tuples(left, right); + } + + } } // namespace boost::tuples + + #endif // !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) + #endif // BOOST_TUPLE_HPP