From 1e1c8a735c96b2f630a6cefae09d57dd4b1dd4ed Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Sun, 11 Apr 2021 16:51:48 +0200 Subject: Use EIGEN_HAS_CXX11 and EIGEN_COMP_CXXVER macros to detect C++ version for `std::result_of` and `std::invoke_result`. Fixes #2209 --- Eigen/src/Core/util/Macros.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Eigen') diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index bdc0de0ea..72ffd2495 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -684,8 +684,7 @@ // Does the compiler support result_of? // result_of was deprecated in c++17 and removed in c++ 20 #ifndef EIGEN_HAS_STD_RESULT_OF -#if EIGEN_MAX_CPP_VER >= 11 && \ - (defined(__cplusplus) && __cplusplus >= 201103L && __cplusplus < 201703L) +#if EIGEN_HAS_CXX11 && EIGEN_COMP_CXXVER < 17 #define EIGEN_HAS_STD_RESULT_OF 1 #else #define EIGEN_HAS_STD_RESULT_OF 0 @@ -704,8 +703,7 @@ #endif // EIGEN_HAS_STD_HASH #ifndef EIGEN_HAS_STD_INVOKE_RESULT -#if EIGEN_MAX_CPP_VER >= 17 && \ - (defined(__cplusplus) && __cplusplus >= 201703L) +#if EIGEN_MAX_CPP_VER >= 17 && EIGEN_COMP_CXXVER >= 17 #define EIGEN_HAS_STD_INVOKE_RESULT 1 #else #define EIGEN_HAS_STD_INVOKE_RESULT 0 -- cgit v1.2.3