【发布时间】:2010-09-23 18:17:49
【问题描述】:
我有一个搜索 STL 容器然后在找到位置时返回迭代器的函数,但是我收到一些有趣的错误消息,能告诉我我做错了什么吗?
功能:
std::vector< CClass >::iterator CClass::SearchFunction( const std::string& strField )
{
...
return it;
...
}
错误:
error C2664: 'std::_Vector_iterator<_Ty,_Alloc>::_Vector_iterator(const std::_Vector_iterator<_Ty,_Alloc> &)' : cannot convert parameter 1 from 'std::_Vector_const_iterator<_Ty,_Alloc> *__w64 ' to 'const std::_Vector_iterator<_Ty,_Alloc> &'
【问题讨论】: