关于assignment operator

来源:互联网 发布:fm2016汉化补丁 mac 编辑:程序博客网 时间:2024/05/29 13:27

1. 自赋值的情况: if (this == &rhs)

2. 返回值为对象的reference: 为了连等的情况。 (a=b)=c

3. exceptional safe 的assignment operator:
   A. http://www.cplusplus.com/articles/y8hv0pDG/
   B. Exceptional C++中, Item 9
   C. why can't  destructor throw?  More effective C++, Item 11
   D. What is exception safe?

4. 左值,右值问题

原创粉丝点击