#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.

This commit is contained in:
shrek1402 2021-01-07 10:12:25 +00:00 committed by David Tellenbach
parent 52d1dd979a
commit cb654b1c45

View File

@ -657,16 +657,15 @@
#endif #endif
// Does the compiler support result_of? // 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, // result_of was deprecated in c++17 and removed in c++ 20
// so let's be conservative.
#ifndef EIGEN_HAS_STD_RESULT_OF #ifndef EIGEN_HAS_STD_RESULT_OF
#if EIGEN_MAX_CPP_VER>=11 && \ #if EIGEN_MAX_CPP_VER >= 11 && \
(__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L) || EIGEN_COMP_MSVC >= 1900) ((defined(__cplusplus) && __cplusplus >= 201103L && __cplusplus < 201703L) || \
__has_feature(cxx_lambdas))
#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
#endif #endif
#endif
#ifndef EIGEN_HAS_ALIGNAS #ifndef EIGEN_HAS_ALIGNAS
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \ #if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \