BOOST_NO_CXX17_STD_INVOKE: Update test case to check we have std::invoke_result.

MSVC has no std::invoke in C++14 mode.
GCC has no std::invoke_result prior to 7.1.
This commit is contained in:
jzmaddock
2018-04-03 19:08:57 +01:00
parent d9d5ece1c8
commit 3764d61f25
3 changed files with 4 additions and 6 deletions

View File

@ -175,7 +175,7 @@
# define BOOST_NO_CXX17_STD_APPLY
# define BOOST_NO_CXX17_ITERATOR_TRAITS
#endif
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650)
#if !defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)
# define BOOST_NO_CXX17_STD_INVOKE
#endif

View File

@ -294,12 +294,10 @@ extern "C" char *gets (char *__s);
#endif
//
// C++17 features in GCC 6.1 and later
// C++17 features in GCC 7.1 and later
//
#if (BOOST_LIBSTDCXX_VERSION < 60100) || (__cplusplus <= 201402L)
# define BOOST_NO_CXX17_STD_INVOKE
#endif
#if (BOOST_LIBSTDCXX_VERSION < 70100) || (__cplusplus <= 201402L)
# define BOOST_NO_CXX17_STD_INVOKE
# define BOOST_NO_CXX17_STD_APPLY
#endif

View File

@ -19,7 +19,7 @@ int foo( int i, int j) {
int test() {
int i = 1, j = 2;
std::invoke( foo, i, j);
typename std::invoke_result<int(&)(int,int), int, int>::type t = std::invoke( foo, i, j);
return 0;
}