How to compile eigen with VS2019, /std:c++latest and /Zc:__cplusplus

Viewed 483

I'm trying to compile eigen 3.3.9 fron the github mirror with VS2019, /std:c++latest and /Zc:__cplusplus

What i get is a

eigen\Eigen\src\Core\util\Meta.h(320,25): error C2039: 'result_of': is not a member of 'std'

because EIGEN_HAS_STD_RESULT_OF is defined. This get's determined here:

#ifndef EIGEN_HAS_STD_RESULT_OF
#if EIGEN_MAX_CPP_VER>=11 && ((__has_feature(cxx_lambdas) || (defined(__cplusplus) && __cplusplus >= 201103L)))
#define EIGEN_HAS_STD_RESULT_OF 1
#else
#define EIGEN_HAS_STD_RESULT_OF 0
#endif
#endif

From what i can read, std::result_of is removed in C++20 which is not reflected in the check above.

Am i doing something wrong? Is there an easy way to compile eigen with VS, C++20 and a __cplusplus define which reflects the actual standard version without having to manually set all the defines myself or patching Macros.h?

0 Answers
Related