diff --git a/include/boost/multiprecision/number.hpp b/include/boost/multiprecision/number.hpp index dc61d696..f99ef2a9 100644 --- a/include/boost/multiprecision/number.hpp +++ b/include/boost/multiprecision/number.hpp @@ -628,8 +628,12 @@ public: return this->template convert_to(); } # else +#if BOOST_WORKAROUND(BOOST_MSVC, < 1900) template - explicit operator T()const +#else + template ::value || !boost::is_default_constructible::value, T>::type> +#endif + explicit operator T ()const { return this->template convert_to(); } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 45e07b9d..c4561d4b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -863,6 +863,7 @@ run test_float_conversions.cpp no_eh_support ; # compile bug11922.cpp ; run bug12039.cpp no_eh_support ; +compile git_issue_30.cpp ; run test_hash.cpp : : : [ check-target-builds ../config//has_float128 : TEST_FLOAT128 quadmath : ] [ check-target-builds ../config//has_gmp : TEST_GMP gmp : ]