mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-23 14:53:13 +08:00
Use EIGEN_HAS_CXX11 and EIGEN_COMP_CXXVER macros to detect C++ version for std::result_of
and std::invoke_result
.
Fixes #2209
This commit is contained in:
parent
f6fc66aa75
commit
1e1c8a735c
@ -684,8 +684,7 @@
|
|||||||
// Does the compiler support result_of?
|
// Does the compiler support result_of?
|
||||||
// result_of was deprecated in c++17 and removed in c++ 20
|
// result_of was deprecated in c++17 and removed in c++ 20
|
||||||
#ifndef EIGEN_HAS_STD_RESULT_OF
|
#ifndef EIGEN_HAS_STD_RESULT_OF
|
||||||
#if EIGEN_MAX_CPP_VER >= 11 && \
|
#if EIGEN_HAS_CXX11 && EIGEN_COMP_CXXVER < 17
|
||||||
(defined(__cplusplus) && __cplusplus >= 201103L && __cplusplus < 201703L)
|
|
||||||
#define EIGEN_HAS_STD_RESULT_OF 1
|
#define EIGEN_HAS_STD_RESULT_OF 1
|
||||||
#else
|
#else
|
||||||
#define EIGEN_HAS_STD_RESULT_OF 0
|
#define EIGEN_HAS_STD_RESULT_OF 0
|
||||||
@ -704,8 +703,7 @@
|
|||||||
#endif // EIGEN_HAS_STD_HASH
|
#endif // EIGEN_HAS_STD_HASH
|
||||||
|
|
||||||
#ifndef EIGEN_HAS_STD_INVOKE_RESULT
|
#ifndef EIGEN_HAS_STD_INVOKE_RESULT
|
||||||
#if EIGEN_MAX_CPP_VER >= 17 && \
|
#if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17
|
||||||
(defined(__cplusplus) && __cplusplus >= 201703L)
|
|
||||||
#define EIGEN_HAS_STD_INVOKE_RESULT 1
|
#define EIGEN_HAS_STD_INVOKE_RESULT 1
|
||||||
#else
|
#else
|
||||||
#define EIGEN_HAS_STD_INVOKE_RESULT 0
|
#define EIGEN_HAS_STD_INVOKE_RESULT 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user