选择, 还是爱自己# Love - 情爱幽幽
h*b
1 楼
class xyz
{
public:
xyz &operator=(const xyz &rhs);
const xyz& operator+(const xyz &rhs) const;
const xyz& operator+(int m);
private:
int n;
};
main()
{
xyz a,b,c;
a=b+c+5; //为啥不对: binary '+' : no operator found which takes a right-
hand operand of type 'int' (or there is no acceptable conversion)
}
感谢
{
public:
xyz &operator=(const xyz &rhs);
const xyz& operator+(const xyz &rhs) const;
const xyz& operator+(int m);
private:
int n;
};
main()
{
xyz a,b,c;
a=b+c+5; //为啥不对: binary '+' : no operator found which takes a right-
hand operand of type 'int' (or there is no acceptable conversion)
}
感谢