visual-studio-2019 - 如何使用 VS2019、/std:c++latest 和 /Zc:__cplusplus 编译 eigen
问题描述
我正在尝试使用 VS2019 从 github 镜像编译 eigen 3.3.9,/std:c++latest
并且/Zc:__cplusplus
我得到的是一个
eigen\Eigen\src\Core\util\Meta.h(320,25): error C2039: 'result_of': is not a member of 'std'
因为EIGEN_HAS_STD_RESULT_OF
被定义。这在这里确定:
#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
从我能读到的,std::result_of
在 C++20 中被删除,这没有反映在上面的检查中。
难道我做错了什么?是否有一种简单的方法可以使用 VS、C++20 和反映实际标准版本__cplusplus
的定义来编译特征,而无需自己手动设置所有定义或修补 Macros.h?
解决方案
推荐阅读
- java - Java 11 编译器无法识别 main 方法中的静态 BiFunction
- mongodb - 如何在 Mongodb 中使用聚合在响应的输出上创建一个数组
- python - 获取 404 的 js 文件
- java - 将文件放在 JAR 的根目录下
- c - 如何将插件 DLL 的依赖项放置在相对于它的特定位置,以便在运行时找到它?
- sql - 使用 SELECT 查询将两张表合二为一,将两张表的记录保存在不同的列中
- c - 如何在现代 OS X 版本上从 C 调用 objc_msgSend
- r - 无法加载 ggplot2 包
- vue.js - 从挂载中获取变量到方法中
- c++ - 带有 unique_ptr(不是 shared_ptr)的 Netbeans 8.2 代码帮助问题