From cb654b1c45ace502727115c3fb7eaddc9fa13abb Mon Sep 17 00:00:00 2001 From: shrek1402 Date: Thu, 7 Jan 2021 10:12:25 +0000 Subject: #define was defined incorrectly because the result_of function was deprecated in c++17 and removed in c++20. Also, EIGEN_COMP_MSVC (which is _MSC_VER) only affects result_of indirectly, which can cause errors. --- Eigen/src/Core/util/Macros.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Eigen/src/Core/util/Macros.h') diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index c021cc32d..6ef90d54f 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -657,16 +657,15 @@ #endif // Does the compiler support result_of? -// It's likely that MSVC 2013 supports result_of but I couldn't not find a good source for that, -// so let's be conservative. +// result_of was deprecated in c++17 and removed in c++ 20 #ifndef EIGEN_HAS_STD_RESULT_OF -#if EIGEN_MAX_CPP_VER>=11 && \ - (__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900) +#if EIGEN_MAX_CPP_VER >= 11 && \ + ((defined(__cplusplus) && __cplusplus >= 201103L && __cplusplus < 201703L) || \ + __has_feature(cxx_lambdas)) #define EIGEN_HAS_STD_RESULT_OF 1 #else #define EIGEN_HAS_STD_RESULT_OF 0 #endif -#endif #ifndef EIGEN_HAS_ALIGNAS #if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \ -- cgit v1.2.3