2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // (C) Copyright Eric Friedman 2002-2003.
4 // (C) Copyright Antony Polukhin 2013.
5 // Use, modification and distribution are subject to the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt).
9 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
11 #ifndef BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
12 #define BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED
14 #include <boost/config.hpp>
15 #include <boost/type_traits/has_trivial_move_assign.hpp>
16 #include <boost/type_traits/has_nothrow_assign.hpp>
17 #include <boost/type_traits/is_array.hpp>
18 #include <boost/type_traits/is_reference.hpp>
19 #include <boost/utility/enable_if.hpp>
20 #include <boost/type_traits/declval.hpp>
24 #ifdef BOOST_IS_NOTHROW_MOVE_ASSIGN
27 struct is_nothrow_move_assignable : public integral_constant<bool, BOOST_IS_NOTHROW_MOVE_ASSIGN(T)>{};
28 template <class T> struct is_nothrow_move_assignable<T const> : public false_type{};
29 template <class T> struct is_nothrow_move_assignable<T volatile> : public false_type{};
30 template <class T> struct is_nothrow_move_assignable<T const volatile> : public false_type{};
31 template <class T> struct is_nothrow_move_assignable<T&> : public false_type{};
32 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
33 template <class T> struct is_nothrow_move_assignable<T&&> : public false_type{};
36 #elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40700)
40 template <class T, class Enable = void>
41 struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {};
44 struct false_or_cpp11_noexcept_move_assignable <
46 typename ::boost::enable_if_c<sizeof(T) && BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>::type
47 > : public ::boost::integral_constant<bool, BOOST_NOEXCEPT_EXPR(::boost::declval<T&>() = ::boost::declval<T>())>
53 struct is_nothrow_move_assignable : public integral_constant<bool, ::boost::detail::false_or_cpp11_noexcept_move_assignable<T>::value>{};
55 template <class T> struct is_nothrow_move_assignable<T const> : public ::boost::false_type {};
56 template <class T> struct is_nothrow_move_assignable<T const volatile> : public ::boost::false_type{};
57 template <class T> struct is_nothrow_move_assignable<T volatile> : public ::boost::false_type{};
58 template <class T> struct is_nothrow_move_assignable<T&> : public ::boost::false_type{};
59 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
60 template <class T> struct is_nothrow_move_assignable<T&&> : public ::boost::false_type{};
66 struct is_nothrow_move_assignable : public integral_constant<bool,
67 (::boost::has_trivial_move_assign<T>::value || ::boost::has_nothrow_assign<T>::value) && ! ::boost::is_array<T>::value>{};
72 template <> struct is_nothrow_move_assignable<void> : public false_type{};
73 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
74 template <> struct is_nothrow_move_assignable<void const> : public false_type{};
75 template <> struct is_nothrow_move_assignable<void const volatile> : public false_type{};
76 template <> struct is_nothrow_move_assignable<void volatile> : public false_type{};
81 #endif // BOOST_TT_IS_NOTHROW_MOVE_ASSIGNABLE_HPP_INCLUDED