关于小于号的重载问题
怎么去重载"< ,>"两个符号,一下是我的类结构,谢谢
class Dstring
{
public:
Dstring(){}
Dstring(const char* str);
Dstring(string str);
Dstring(const Dstring& str);
Dstring& operator=(const char* str);
Dstring& operator=(const Dstring& str);
bool operator==(const Dstring& );
bool operator>(Dstring& str);
bool operator!=(const Dstring& );
bool operator<(Dstring& str);
Dstring& operator+=(const string& str);
Dstring& operator+(const string& str);
Dstring& operator+(const char* str);
string getString()const {return srcstr;}
private:
string srcstr;
};
错误信息:error C2679: binary '<' : no operator found which takes a right-hand operand of type 'const Dstring'