16,471
社区成员
发帖
与我相关
我的任务
分享
class GETREC
{
friend class SEARCHREC;
public:
//..成员函数
private:
struct RECORD
{
//....
};
vector<RECORD> NewRec;
//...
};
class SEARCHREC
{
public:
SEARCHREC(const vector<RECORD>&);
//...
private:
vector<RECORD>::iterator ITER;
/...
};
//在后面的GETREC类的成员函数中,使用了如下的代码
//.....
SEARCHREC NewSearch(NewRec);
//然后是SEARCHREC的构造函数中
SEARCHREC::SEARCHREC(const vector<RECORD> &TarRec)
{
ITER=TarRec.begin(); //Initializing iterator
//...
1>d:\ASSIGNMENT\GetData\searchdata.cpp(5) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::_Vector_const_iterator<_Ty,_Alloc>' (or there is no acceptable conversion)
1> with
1> [
1> _Ty=RECORD,
1> _Alloc=std::allocator<RECORD>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\include\vector(405): could be 'std::_Vector_iterator<_Ty,_Alloc> &std::_Vector_iterator<_Ty,_Alloc>::operator =(const std::_Vector_iterator<_Ty,_Alloc> &)'
1> with
1> [
1> _Ty=RECORD,
1> _Alloc=std::allocator<RECORD>
1> ]
1> while trying to match the argument list '(std::_Vector_iterator<_Ty,_Alloc>, std::_Vector_const_iterator<_Ty,_Alloc>)'
1> with
1> [
1> _Ty=RECORD,
1> _Alloc=std::allocator<RECORD>
1> ]