Ray's playground

 

2009年12月26日

Item 8: Prevent exceptions from leaving destructors(Effective C++)

摘要: Destructors should never emit exceptions. If functions called in a destructor may throw, the destructor should catch any exceptions, then swallow them or terminate the program.If class clients need ... 阅读全文

posted @ 2009-12-26 15:44 Ray Z 阅读(256) 评论(0) 推荐(0) 编辑

Item 7: Declare destructors virtual in polymorphic base classes(Effective C++)

摘要: Polymorphic base classes should declare virtual destructors. If a class has any virtual functions, it should have a virtual destructor.Classes not designed to be base classes or not designed to be use... 阅读全文

posted @ 2009-12-26 13:22 Ray Z 阅读(206) 评论(0) 推荐(0) 编辑

Item 6: Explicitly disallow the use of compiler-generated functions you do not want(Effective C++)

摘要: To disallow functionality automatically provided by compilers, declare the corresponding member functions private and give no implementations. Using a base class like Uncopyable is one way to do this. 阅读全文

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

导航