草庐IT

IntWrapper

全部标签

c++ - 继承类中的比较运算符

我已经定义了一个IntWrapper类,如下所示:structIntWrapper{protected:intvalue;public:explicitIntWrapper()=default;explicitIntWrapper(constintvalue):value(value){}booloperator(constIntWrapperrhs)const{returnvalue>rhs.value;}booloperator=(constIntWrapperrhs)const{returnvalue>=rhs.value;}booloperator==(constIntWrap

c++ - 继承类中的比较运算符

我已经定义了一个IntWrapper类,如下所示:structIntWrapper{protected:intvalue;public:explicitIntWrapper()=default;explicitIntWrapper(constintvalue):value(value){}booloperator(constIntWrapperrhs)const{returnvalue>rhs.value;}booloperator=(constIntWrapperrhs)const{returnvalue>=rhs.value;}booloperator==(constIntWrap