Hi all,
I am trying to overload the < operator, but get warning
class Windowinfo
{
protected:
HWND wndhandle; //the window handle
int wndId; //the window Id
public:
Windowinfo();
Windowinfo(const Windowinfo &wnd);
friend bool operator <(const Windowinfo &left,const
Windowinfo &right)
{
if(left.wndId<right.wndId)
left<right;
else
right<left;
return true;
}
};
The warning: warning C4717: 'operator<' : recursive on all control
paths, function will cause runtime stack overflow.
I think maybe the overload function calles itself. how to solve it?
Thanks.