关于重载运算符的一些问题
查看原帖
关于重载运算符的一些问题
200897
Earth执剑人罗辑楼主2020/11/17 07:41
struct Node {
	int x,y;
	Node() {
		x = y = 0;
	}
	Node operator & (const Node &el) const {
		return (Node)<%x&el.x, y&el.y%>;
	}
	Node operator | (const Node &el) const {
		return (Node)<%x|el.x, y|el.y%>;
	}
	Node operator ^ (const Node &el) const {
		return (Node)<%x^el.x, y^el.y%>;
	}
};

这段代码为什么会报错。求助各位大佬,谢谢!

2020/11/17 07:41
加载中...