Ray's playground

 

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 to be able to react to exceptions thrown during an operation, the class should provide a regular (i.e., non-destructor) function that performs the operation.

posted on 2009-12-26 15:44  Ray Z  阅读(256)  评论(0编辑  收藏  举报

导航