The following errors are always been pointing to my List.
我的班子档案
Point3D operator==(const Point3D &p1) const;
在我的档案中
bool operator==(Point3D &p1, Point3D &p2)
{
if ( p1.getX() == p2.getX() && p1.getY() == p2.getY() && p1.getZ() == p2.getZ() )
return true;
else
return false;
}
In my main file
//declaration
list<Point3D> l_3D;
l_3D.unique(); <-- the error point to this
错误信息
..... In member function void std::list<_Tp,_Alloc>::unique() [with_Tp = Point3D,_Alloc = std:: allocator<Point3D>]:
Instantiated from here
error: could not convert Point3D::operator==(const Point3D&) const (((const Point3D&)((const Point3D*)__next. std::_List_iterator<_Tp>::operator*[with_Tp = Point3D]()))) to bool
To the kind souls out there, I thank you in advance.