Я пытаюсь выяснить, что делает этот кусок кода:
std::vector<std::vector<bool> > visited(rows, std::vector<bool>(cols, 0));
'строки' и 'столбцы' являются целыми числами.
Он вызывает конструктор, но я не уверен как.
Это пример кода, который я получил из какого-то проекта ...
Это также дает мне следующее предупреждение:
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> ]
Может ли кто-нибудь помочь?