diff --git a/include/boost/type_traits/is_nothrow_move_assignable.hpp b/include/boost/type_traits/is_nothrow_move_assignable.hpp index c55dfc6..7acbcce 100644 --- a/include/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/include/boost/type_traits/is_nothrow_move_assignable.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -30,7 +29,7 @@ namespace boost { namespace detail{ -#ifndef BOOST_NO_CXX11_NOEXCEPT +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) template struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {}; @@ -38,20 +37,28 @@ struct false_or_cpp11_noexcept_move_assignable: public ::boost::false_type {}; template struct false_or_cpp11_noexcept_move_assignable < T, - typename ::boost::enable_if_c::value && BOOST_NOEXCEPT_EXPR(::boost::declval() = ::boost::declval())>::type + typename ::boost::enable_if_c() = ::boost::declval())>::type > : public ::boost::integral_constant() = ::boost::declval())> {}; template struct is_nothrow_move_assignable_imp{ - BOOST_STATIC_CONSTANT(bool, value = ( - ::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value, - ::boost::type_traits::ice_not< ::boost::is_reference::value >::value, - ::boost::detail::false_or_cpp11_noexcept_move_assignable::value - >::value)); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_assignable::value); }; +template +struct is_nothrow_move_assignable_imp : public ::boost::false_type {}; +template +struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +template +struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +template +struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template +struct is_nothrow_move_assignable_imp : public ::boost::false_type{}; +#endif + #else template diff --git a/include/boost/type_traits/is_nothrow_move_constructible.hpp b/include/boost/type_traits/is_nothrow_move_constructible.hpp index bc7fb88..b8a657a 100644 --- a/include/boost/type_traits/is_nothrow_move_constructible.hpp +++ b/include/boost/type_traits/is_nothrow_move_constructible.hpp @@ -28,7 +28,7 @@ namespace boost { namespace detail{ -#ifndef BOOST_NO_CXX11_NOEXCEPT +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) template struct false_or_cpp11_noexcept_move_constructible: public ::boost::false_type {}; @@ -42,14 +42,20 @@ struct false_or_cpp11_noexcept_move_constructible < template struct is_nothrow_move_constructible_imp{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::type_traits::ice_and< - ::boost::type_traits::ice_not< ::boost::is_volatile::value >::value, - ::boost::type_traits::ice_not< ::boost::is_reference::value >::value, - ::boost::detail::false_or_cpp11_noexcept_move_constructible::value - >::value)); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::false_or_cpp11_noexcept_move_constructible::value); }; +template +struct is_nothrow_move_constructible_imp : public ::boost::false_type {}; +template +struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +template +struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +template +struct is_nothrow_move_constructible_imp : public ::boost::false_type{}; +#endif + #else template diff --git a/test/is_nothrow_move_assignable_test.cpp b/test/is_nothrow_move_assignable_test.cpp index 2202701..7522a6e 100644 --- a/test/is_nothrow_move_assignable_test.cpp +++ b/test/is_nothrow_move_assignable_test.cpp @@ -195,12 +195,20 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true); +#else // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, true, false); +#endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_assignable::value, false); diff --git a/test/is_nothrow_move_constructible_test.cpp b/test/is_nothrow_move_constructible_test.cpp index e17c3fd..6f6ccfb 100644 --- a/test/is_nothrow_move_constructible_test.cpp +++ b/test/is_nothrow_move_constructible_test.cpp @@ -191,12 +191,20 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::va BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); +#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true); +#else // cases we would like to succeed but can't implement in the language: BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, true, false); +#endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_nothrow_move_constructible::value, false);