//  Boost general library swap.hpp header file  ---------------------------//

//  (C) Copyright Hamish Mackenzie 2002. Permission to copy, use, modify, sell and
//  distribute this software is granted provided this copyright notice appears
//  in all copies. This software is provided "as is" without express or implied
//  warranty, and with no claim as to its suitability for any purpose.

//  See http://www.boost.org for updates, documentation, and revision history.

#ifndef BOOST_SWAP_HPP
#define BOOST_SWAP_HPP

namespace boost_swap_detail
{

template< typename T >
void swap( T & a1, T & a2 )
{
  T temp( a1 );
  a1 = a2;
  a2 = temp;
}

template< typename T >
void swap_impl( T & a1, T & a2 )
{
  swap( a1, a2 );
}

} // namespace boost_swap_detail

namespace boost
{

template< typename T >
void swap( T & a1, T & a2 )
{
  boost_swap_detail::swap_impl( a1, a2 );
}

} // namespace boost

#endif // BOOST_SWAP_HPP

