class item {
public:
item& operator=(const item &rh) {
...
...
return *this;
}
};
以下签名是否错误?为什么重载赋值操作符返回对类的引用?
void operator=(const item &rh);
item a, b;
a = b; // equivalent to a.operator=(b); so there is no need to return this.
关键是这是什么内置的类型 –