我用的是vs2017,在使用reduce
函数时:
auto norm = 1.f / std::reduce(t_, t_ + channels);
标题是:
#include "numeric"
我得到以下错误:
error c2039 “reduce”: is not member of std.
但据我所知,在c++17中已经添加了reduce函数。我该怎么办?
最佳答案
你应该使用 #include <numeric>
而不是 #include "numeric"
<> 用于系统包含,""用于本地 header 。
第二件事是 VS2017 不完全支持 c++17,这就是我猜的问题。 还要确保您已启用 c++17 开关 How to enable C++17 compiling in Visual Studio?
关于c++ - 关于 std::reduce vs2017 中的未知数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52362801/