最近我写了下面的类:
class CLine : public CObject  
{
public:
//
//Constructors of this class
//
CLine();
CLine(CPoint start,CPoint end,COLORREF color,int with);
virtual ~CLine(); //
//Operations of this class
//
BOOL operator == (CLine line)const;

//
//Attributes of this class
//
int m_with;
COLORREF m_color;
CPoint m_end;
CPoint m_start;
};
错误提示如下:
binary '==' : no operator defined which takes a left-hand operand of type 'const class CLine' (or there is no acceptable conversion)重载函数如下:
BOOL CLine::operator == (CLine line)const
{
return ((m_color==line.m_color)&&
(m_end==line.m_end)&&
(m_start==line.m_start)&&
(m_with==line.m_with));
}