如何使用 VS2019、/std:c++latest 和 /Zc:__cplusplus 编译 eigen

问题描述

我正在尝试使用 VS2019、/std:c++latest/Zc:__cplusplus

从 github 镜像编译 eigen 3.3.9

我得到的是一个

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

因为定义了 EIGEN_HAS_STD_RESULT_OF。此获取已确定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

从 i can read 中,std::result_of 在 C++20 中被删除,这没有反映在上面的检查中。

我做错了吗?是否有一种简单的方法可以使用 VS、C++20 和 __cplusplus 定义哪个 reflects the actual standard version 而不必manually set all the defines 自己或修补 Macros.h?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)