std::vector<std::string>::iterator it;
it = NULL;
do
{
if(it == NULL)
it = init.begin();
else
++it;
if(it == init.end())
return 1;
}
while(it->empty());
Приведенный выше фрагмент кода прекрасно работает с VS2003, но при переносе на VS2010 выдает ошибку компиляции, говоря
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
1> c:\program files\microsoft visual studio 10.0\vc\include\vector(388): could be 'std::_Vector_iterator<_Myvec> &std::_Vector_iterator<_Myvec>::operator =(const std::_Vector_iterator<_Myvec> &)'
1> with
1> [
1> _Myvec=std::_Vector_val<std::string,std::allocator<std::string>>
1> ]
1> while trying to match the argument list '(std::_Vector_iterator<_Myvec>, int)'
1> with
1> [
1> _Myvec=std::_Vector_val<std::string,std::allocator<std::string>>
1> ]
1>d:\vs2010_ws\acct ford 6.2.4 source code\acct_ford_ws\vector\src\driver\cancardxl.cpp(81): error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::_Vector_iterator<_Myvec>' (or there is no acceptable conversion)
1> with
1> [
1> _Myvec=std::_Vector_val<std::string,std::allocator<std::string>>
1> ]