/*
-Copyright Barrett Adair 2016-2017
+Copyright Barrett Adair 2016-2021
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
*/
template<typename Callable>
void operator()(tag<Callable>) const {
-// when available, test parity with std implementation (c++2a breaks our expectations but we still match std impl)
-#if defined(__cpp_lib_is_invocable) || __cplusplus >= 201707L
+ CT_ASSERT((Expect == boost::callable_traits::is_invocable<Callable, Args...>()));
+#ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
+ CT_ASSERT((Expect == boost::callable_traits::is_invocable_v<Callable, Args...>));
+#endif
+
+// when available, test parity with std implementation
+#if defined(__cpp_lib_is_invocable)
CT_ASSERT((std::is_invocable<Callable, Args...>() == boost::callable_traits::is_invocable<Callable, Args...>()));
# ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
CT_ASSERT((std::is_invocable_v<Callable, Args...> == boost::callable_traits::is_invocable_v<Callable, Args...>));
# endif
-#else
- CT_ASSERT((Expect == boost::callable_traits::is_invocable<Callable, Args...>()));
-# ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES
- CT_ASSERT((Expect == boost::callable_traits::is_invocable_v<Callable, Args...>));
-# endif
#endif
}
,invoke_case<false, std::reference_wrapper<foo>, int>
>();
-// MSVC doesn't handle cv + ref qualifiers in expression sfinae correctly
-#ifndef BOOST_CLBL_TRTS_MSVC
+// old MSVC doesn't handle cv + ref qualifiers in expression sfinae correctly
+#ifndef BOOST_CLBL_TRTS_OLD_MSVC
+
+#if __cplusplus <= 201703L
+#define QUIRKY_CASE true
+#else
+#define QUIRKY_CASE false
+#endif
run_tests<void(foo::*)() const LREF
- ,invoke_case<false, foo>
+
+#ifndef BOOST_CLBL_TRTS_MSVC
+ ,invoke_case<!QUIRKY_CASE, foo>
+ ,invoke_case<!QUIRKY_CASE, foo&&>
+ ,invoke_case<!QUIRKY_CASE, foo const>
+ ,invoke_case<!QUIRKY_CASE, foo const&&>
+#endif
,invoke_case<true, foo*>
,invoke_case<true, foo&>
- ,invoke_case<false, foo&&>
,invoke_case<true, std::reference_wrapper<foo>>
- ,invoke_case<false, foo const>
,invoke_case<true, foo const*>
,invoke_case<true, foo const&>
- ,invoke_case<false, foo const&&>
,invoke_case<true, std::reference_wrapper<foo const>>
,invoke_case<false, foo, int>
,invoke_case<false, foo*, int>
,invoke_case<false, std::reference_wrapper<foo>, int>
>();
-#endif // #ifndef BOOST_CLBL_TRTS_MSVC
+#endif // #ifndef BOOST_CLBL_TRTS_OLD_MSVC
run_tests<int
,invoke_case<false, foo>