我有一个类,构造函数如下所示:
myclass(int=0,string="",int=0,string="",int=0,int=0,
int=0,int=0,string="",int=0,int=0);
和带有这种类型元素的向量
vector<myclass>myvect;
向量已排序,我正在尝试删除重复项,但这不起作用:
std::vector<myclass>::iterator it;
it=std::unique (myvect.begin(), myvect.end());
myvect.resize(std::distance(myvect.begin(),it) );
我收到这个错误
:algorithm(1862): error C2678: binary '==' :
no operator found which takes a left-hand operand
of type 'myclass' (or there is no acceptable conversion)
知道为什么吗?有什么办法可以从这个向量中删除重复项?