c++11改c++17开启/WX警告被视为错误
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility:4096: error: C2220: 以下警告被视为错误
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xutility(4096): error C2220: 以下警告被视为错误
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(1162): note: 查看对正在编译的函数 模板 实例化“_OutIt *std::_Copy_unchecked<_Iter,float*>(_InIt,_InIt,_OutIt)”的引用
with
[
_OutIt=float *,
_Iter=const int *,
_InIt=const int *
]
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(1176): note: 查看对正在编译的函数 模板 实例化“void std::vector<float,std::allocator<float>>::_Assign_range<const int*>(_Iter,_Iter,std::forward_iterator_tag)”的引用
with
[
_Iter=const int *
]
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\vector(1176): note: 查看对正在编译的函数 模板 实例化“void std::vector<float,std::allocator<float>>::_Assign_range<const int*>(_Iter,_Iter,std::forward_iterator_tag)”的引用
with
[
_Iter=const int *
]
D:\QtProject\LedDetector11\colorclassify.cpp(26): note: 查看对正在编译的函数 模板 实例化“void std::vector<float,std::allocator<float>>::assign<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,0>(_Iter,_Iter)”的引用
with
[
_Ty=int,
_Iter=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<int>>>
]
D:\QtProject\LedDetector11\colorclassify.cpp(26): note: 查看对正在编译的函数 模板 实例化“void std::vector<float,std::allocator<float>>::assign<std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<_Ty>>>,0>(_Iter,_Iter)”的引用
with
[
_Ty=int,
_Iter=std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<int>>>
]
引发错误代码
struct HistInfo {
std::vector<float> hist;
std::vector<int> argsort;
std::vector<float> sort_normal;
std::vector<float> arg_values;
};
ColorClassify::HistInfo ColorClassify::process_hist_channel(
const std::vector<int>& hist_data, const std::vector<float>& bin_edges)
{
HistInfo info;
info.hist.assign(hist_data.begin(), hist_data.end());
将一个std::vector<int>使用assign复制到一个std::vector<float>引发的问题

浙公网安备 33010602011771号