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

0

6

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?

Regiment answered 28/2, 2021 at 21:24 Comment(2)
The #if check appears to have been updated in the current eigen sources here.Purine
@Purine Hopefully they port it back to the stable 3.3.x soon :)Regiment

© 2022 - 2024 — McMap. All rights reserved.