From 66a146c1cb2cbb6fe9ab9b2fa986cfca2fa79e4c Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 10 Aug 2018 18:13:02 +0100 Subject: [PATCH] Disable additional specialization for is_function for msvc-10.0 - it doesn't work and leads to ambiguous overloads. Also change the expected result of some tests for msvc-14.0. --- include/boost/type_traits/is_function.hpp | 3 +++ test/has_unary_plus_test.cpp | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index 805cd70..f75dd2e 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -13,6 +13,7 @@ #include #include +#include #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) # include @@ -96,8 +97,10 @@ template struct is_function : integral_constant struct is_function : public false_type {}; #endif +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1600) template struct is_function : public false_type {}; #endif +#endif } // namespace boost #endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED diff --git a/test/has_unary_plus_test.cpp b/test/has_unary_plus_test.cpp index 0c28250..e24d833 100644 --- a/test/has_unary_plus_test.cpp +++ b/test/has_unary_plus_test.cpp @@ -223,10 +223,15 @@ void specific() { // There are some things that pass that wouldn't otherwise do so: auto f = []() {}; auto f2 = [](double)->int { return 2; }; - BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); - BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); - BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); - BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1900) + bool result = false; +#else + bool result = true; +#endif + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0);