Ray's playground

 

2009年12月27日

Item 11: Handle assignment to self in operator=(Effective C++)

摘要: Make sure operator= is well-behaved when an object is assigned to itself. Techniques include comparing addresses of source and target objects, careful statement ordering, and copy-and-swap.Make sure... 阅读全文

posted @ 2009-12-27 13:31 Ray Z 阅读(163) 评论(0) 推荐(0) 编辑

Item 10: Have assignment operators return a reference to *this(Effective C++)

摘要: Have assignment operators return a reference to *this. 阅读全文

posted @ 2009-12-27 10:31 Ray Z 阅读(172) 评论(0) 推荐(0) 编辑

Item 9: Never call virtual functions during construction or destruction(Effective C++)

摘要: Don't call virtual functions during construction or destruction, because such calls will never go to a more derived class than that of the currently executing constructor or destructor. 阅读全文

posted @ 2009-12-27 09:43 Ray Z 阅读(196) 评论(0) 推荐(0) 编辑

导航