条款10-11:令operator=返回一个reference to *this
2017-12-26 09:17
330 查看
条款10:令operator=返回一个reference to *this,这是为了方便连续赋值,并且满足右结合律
条款11:在operator=中处理自我赋值
确保对象自我赋值时operator=有着良好行为,比较来源对象和目标对象的地址、精心周到的语句顺序;以及copy-and-swap技术
确保函数操作一个以上对象,而多个对象指向同一个对象时,行为仍然正确
条款11:在operator=中处理自我赋值
确保对象自我赋值时operator=有着良好行为,比较来源对象和目标对象的地址、精心周到的语句顺序;以及copy-and-swap技术
确保函数操作一个以上对象,而多个对象指向同一个对象时,行为仍然正确
相关文章推荐
- 条款10:令operator=返回一个reference to *this
- 《Effect C++》学习------条款10:令 operator= 返回一个 reference to *this
- 条款10:令operator=返回一个reference to * this(Have assignment operators return a reference to *this)
- 《Effective C++ 》条款10:令operator=返回一个reference to *this
- Effective C++ 条款10:令operator= 返回一个reference to *this
- 《Effective C++》学习笔记条款10 令operator= 返回一个reference to *this
- 条款10 令operator=返回一个reference to *this
- Effective C++:条款10:令operator=返回一个reference to *this。
- 条款10:令operator=返回一个reference to *this
- effective C++ 条款 10:operator= 返回一个reference to *this
- Effective C++ -----条款10: 令operator=返回一个reference to *this
- 条款10:令operator=返回一个reference to * this
- 条款10:令operator = 返回一个reference to *this
- 条款10:令operator=返回一个reference to *this
- 条款10:令operator=返回一个reference to *this(Have assignment operators return a reference to *this.)
- 条款10 令operator=返回一个reference to *this
- 【effective c++】条款10:令operator=返回一个reference to *this
- 条款10:令operator=返回一个reference to *this
- 条款10:令operator= 返回一个reference to *this
- 条款10:令operator= 返回一个reference to *this