2014-06-01 18:08:55 -07:00
|
|
|
// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker
|
|
|
|
|
//
|
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See
|
|
|
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
|
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
// For more information, see http://www.boost.org
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef BOOST_CORE_SWAP_HPP
|
|
|
|
|
#define BOOST_CORE_SWAP_HPP
|
|
|
|
|
|
|
|
|
|
// Note: the implementation of this utility contains various workarounds:
|
|
|
|
|
// - boost::swap has two template arguments, instead of one, to
|
|
|
|
|
// avoid ambiguity when swapping objects of a Boost type that does
|
|
|
|
|
// not have its own boost::swap overload.
|
|
|
|
|
|
2018-10-24 12:23:56 +03:00
|
|
|
#include <boost/core/enable_if.hpp>
|
|
|
|
|
#include <boost/config.hpp>
|
2023-07-11 01:45:19 +03:00
|
|
|
#include <boost/config/header_deprecated.hpp>
|
|
|
|
|
#include <boost/core/invoke_swap.hpp>
|
2019-12-01 17:26:58 +03:00
|
|
|
|
2023-01-07 03:52:46 +03:00
|
|
|
#ifdef BOOST_HAS_PRAGMA_ONCE
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-07-11 01:45:19 +03:00
|
|
|
BOOST_HEADER_DEPRECATED("boost/core/invoke_swap.hpp")
|
2014-06-01 18:08:55 -07:00
|
|
|
|
|
|
|
|
namespace boost
|
|
|
|
|
{
|
|
|
|
|
template<class T1, class T2>
|
|
|
|
|
BOOST_GPU_ENABLED
|
2023-07-11 01:45:19 +03:00
|
|
|
BOOST_DEPRECATED("This function is deprecated, use boost::core::invoke_swap instead.")
|
|
|
|
|
inline typename enable_if_c< !boost_swap_impl::is_const<T1>::value && !boost_swap_impl::is_const<T2>::value >::type
|
2018-10-24 12:23:56 +03:00
|
|
|
swap(T1& left, T2& right)
|
2014-06-01 18:08:55 -07:00
|
|
|
{
|
2023-07-11 01:45:19 +03:00
|
|
|
boost::core::invoke_swap(left, right);
|
2014-06-01 18:08:55 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-07 03:52:46 +03:00
|
|
|
#endif // BOOST_CORE_SWAP_HPP
|