帮忙看一个重载,谢谢
//帮忙看一下,那个!=重载对没?好像没错。。。
//编译错误:赋值运算中的左值无效
struct fib_node{
fib_node *left;
fib_node *right;
fib_node *parent;
fib_node *child;
int key;
int degree;
bool mark;
bool operator!=(fib_node &other)
{
return (this-> left != other.left || this-> right != other.right || this-> parent != other.parent
|| this-> child = other.child || this-> key != other.key || this-> degree != other.degree
|| this-> mark != other.mark);
}//!=
};
[解决办法]
this-> child = other.child
少了!