c++ - 如何更改 unit_test/修复纯函数错误
问题描述
/usr/include/boost/test/auto_unit_test.hpp:17:1: note: #pragma message: This header is deprecated. Use This header is deprecated. Please use <boost/test/unit_test.hpp> instead. instead.
17 | BOOST_HEADER_DEPRECATED( "This header is deprecated. Please use <boost/test/unit_test.hpp> instead." )
| ^~~~~~~~~~~~~~~~~~~~~~~
[C++] jml/arch/simd_vector.cc
./jml/arch/simd_vector.cc:46:61: error: ‘pure’ attribute on function returning ‘void’ [-Werror=attributes]
46 | void vec_scale(const float * x, float k, float * r, size_t n)
| ^
cc1plus: all warnings being treated as errors
制作:*** [jml/arch//arch.mk:27: build/x86_64/obj/jml/arch/simd_vector.894c3fd093070a25659bff4e67647992.lo] 错误
另外:/jml/arch/fslock.cc:23:18:错误:命名空间“std”中的“函数”未命名模板类型 23 | typedef std::function<void ()> Fn; | ^~~~~~~~ ./jml/arch/fslock.cc:14:1: 注意: 'std::function' 定义在头文件''; 你忘了'#include'吗?13 | #include "fslock.h" +++ |+#include 14 | ./jml/arch/fslock.cc:25:22:错误:'Fn' 未命名类型 25 | Call_Guard(const Fn & fn) | ^~ ./jml/arch/fslock.cc:36:5: 错误:'Fn' 没有命名类型 36 | Fn fn_; | ^~ ./jml/arch/fslock.cc: 在构造函数'{anonymous}::Call_Guard::Call_Guard(const int&)': ./jml/arch/fslock.cc:26:11: 错误:类'{anonymous }::Call_Guard' 没有
任何名为“fn_”的字段 26 | : fn_(fn) | ^~~ ./jml/arch/fslock.cc:在析构函数“{anonymous}::Call_Guard::~Call_Guard()”中:./jml/arch/fslock.cc:32:13:错误:“fn_”是未在此范围内声明 32 | 如果(fn_)fn_();|
解决方案
推荐阅读
- file - 如何复制FTP路径中的文件
- fabricjs - Fabricjs 2.0 如何为文本框的子字符串设置下划线
- android - `Anko` 给出异常 AnkoException: Id is not set
- karate - 如何在空手道中添加配置文件变量
- java - KafkaAvroDeserializer - NoClassDefFoundError:io/confluent/common/config/ConfigException
- android - 改造 FormUrlEncoded 请求不使用对象数组作为字段
- angular - 如何使用结构指令更改边框?
- android - XamarinForms APK 无法安装 - 未安装应用程序
- javascript - 组件中的 store.getState 或 mapStateToProps
- python - 如何仅使用 Pandas 执行矢量化分箱