Need for try catch within a constructor
问题 The link http://gotw.ca/gotw/066.htm states that Moral #1: Constructor function-try-block handlers have only one purpose -- to translate an exception. (And maybe to do logging or some other side effects.) They are not useful for any other purpose. While http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.8 If a constructor throws an exception, the object's destructor is not run. If your object has already done something that needs to be undone (such as allocating some memory, opening