1
我试图搞清楚这段代码的作用:警告上的std ::矢量构造
std::vector<std::vector<bool> > visited(rows, std::vector<bool>(cols, 0));
“行”和“的cols”都是整数。
它调用构造函数,但我不知道如何。 它的样本代码,我从一些项目得到了...
它也给了我以下警告:
c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(2140): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(2126) : see reference to function template instantiation 'void std::vector<_Ty,_Ax>::_BConstruct<_Iter>(_Iter,_Iter,std::_Int_iterator_tag)' being compiled
1> with
1> [
1> _Ty=bool,
1> _Ax=std::allocator<bool>,
1> _Iter=int
1> ]
1> c:\ai challenge\code\project\project\state.cpp(85) : see reference to function template instantiation 'std::vector<_Ty,_Ax>::vector<int>(_Iter,_Iter)' being compiled
1> with
1> [
1> _Ty=bool,
1> _Ax=std::allocator<bool>,
1> _Iter=int
1> ]
谁能帮助?
谢谢,那帮了:) – xcrypt