【C++】令operator= 返回一个reference to *this

这几天看到《Effective C++》中条款10中, 令operator= 返回一个reference to *this, 说这个是协议, 并无强制性,这个协议被因此内置类型和标准程序库提供的类型如string, vector, complex,tr::shared_ptr所接受。ios 对operator=返回值类型的讨论 举个书上的例子:web int x,y,z; x = y = z =
相关文章
相关标签/搜索