#ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED #define BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED // Copyright 2017 Peter Dimov // // 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 #include #include #if defined(BOOST_NO_SFINAE_EXPR) || defined(BOOST_NO_CXX11_NOEXCEPT) || defined(BOOST_NO_CXX11_DECLTYPE) \ || defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) || BOOST_WORKAROUND(BOOST_GCC, < 40700) #include #include #include namespace boost { template struct is_nothrow_swappable : boost::integral_constant::value && !boost::is_const::value> {}; template struct is_nothrow_swappable_with : false_type {}; template struct is_nothrow_swappable_with : is_nothrow_swappable {}; } #else #include #include #include namespace boost { namespace type_traits_swappable_detail { using std::swap; template(), declval()))> integral_constant is_nothrow_swappable_with_impl( int ); template false_type is_nothrow_swappable_with_impl( ... ); template struct is_nothrow_swappable_with_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_with_impl(0) ) type; }; template(), declval()))> integral_constant is_nothrow_swappable_impl( int ); template false_type is_nothrow_swappable_impl( ... ); template struct is_nothrow_swappable_helper { typedef decltype( type_traits_swappable_detail::is_nothrow_swappable_impl(0) ) type; }; } // namespace type_traits_swappable_detail template struct is_nothrow_swappable_with: type_traits_swappable_detail::is_nothrow_swappable_with_helper::type { }; template struct is_nothrow_swappable: type_traits_swappable_detail::is_nothrow_swappable_helper::type { }; } // namespace boost #endif #endif // #ifndef BOOST_TYPE_TRAITS_IS_NOTHROW_SWAPPABLE_HPP_INCLUDED