标签: c++ assignment-operator
可能重复: Overloading assignment operator in C++ C++ why the assignment operator should return a const ref in order to avoid (a=b)=c
为什么大多数书籍都建议赋值运算符返回引用?为什么不const参考?
const
const将使(a = b)= c这样的奇怪代码无法编译,这是一件好事。