diff --git a/include/boost/compat/invoke.hpp b/include/boost/compat/invoke.hpp index 6462217..e47ee56 100644 --- a/include/boost/compat/invoke.hpp +++ b/include/boost/compat/invoke.hpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include namespace boost { @@ -40,6 +42,12 @@ template struct is_invocable: detail::is_invocable_ struct is_nothrow_invocable: std::false_type {}; + +#else + namespace detail { template struct is_nothrow_invocable_ @@ -51,6 +59,8 @@ template struct is_nothrow_invocable_ template struct is_nothrow_invocable: conditional_t< is_invocable::value, detail::is_nothrow_invocable_, std::false_type >::type {}; +#endif + } // namespace compat } // namespace boost diff --git a/test/is_nothrow_invocable_test.cpp b/test/is_nothrow_invocable_test.cpp index 68efb36..1a19871 100644 --- a/test/is_nothrow_invocable_test.cpp +++ b/test/is_nothrow_invocable_test.cpp @@ -4,6 +4,8 @@ #include #include +#include +#include struct F { @@ -84,10 +86,15 @@ int main() // object BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); - BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) + + BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); +#endif + BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); @@ -117,6 +124,8 @@ int main() // member data pointer +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) + BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); @@ -124,6 +133,8 @@ int main() BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_TRUE(( is_nothrow_invocable )); +#endif + BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable )); BOOST_TEST_TRAIT_FALSE(( is_nothrow_invocable ));