From c845f41f2d9b185f424c496ee753633fee712dc4 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Wed, 24 Sep 2014 14:32:04 +0200 Subject: [PATCH] Compile fix for MSVC14 MSVC14 supports noexcept, but doesn't support expression SFINAE, so false_or_cpp11_noexcept_move_assignable fails to compile with error C3892: 'boost::declval': you cannot assign to a variable that is const Disabling the overload for const types so that they are never reported as noexcept move assignable fixes the compile error. Of course this doesn't work for imaginary UDTs with an assignment operator that is marked both noexcept and const - the alternative would be to guard the block with BOOST_NO_SFINAE_EXPR in addition to BOOST_NO_CXX11_NOEXCEPT. --- include/boost/type_traits/is_nothrow_move_assignable.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/is_nothrow_move_assignable.hpp b/include/boost/type_traits/is_nothrow_move_assignable.hpp index 5a3427f..c55dfc6 100644 --- a/include/boost/type_traits/is_nothrow_move_assignable.hpp +++ b/include/boost/type_traits/is_nothrow_move_assignable.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -37,7 +38,7 @@ 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() = ::boost::declval())>::type + typename ::boost::enable_if_c::value && BOOST_NOEXCEPT_EXPR(::boost::declval() = ::boost::declval())>::type > : public ::boost::integral_constant() = ::boost::declval())> {};