Constructors - throw an exception if failed
-
Hi all, I want my constructors (default, overloaded, and copy) to throw an exception if they fail. My questions are 1) How can I test to see if the constructor has failed? 2) Should I create an exception class to throw exception objects rather than using text strings/integer codes? 3) Where does the catch block go? In the constructor body, or after creating an object in the .cpp file? Thanks, Daniel Obseve everything, remember more...
-
Hi all, I want my constructors (default, overloaded, and copy) to throw an exception if they fail. My questions are 1) How can I test to see if the constructor has failed? 2) Should I create an exception class to throw exception objects rather than using text strings/integer codes? 3) Where does the catch block go? In the constructor body, or after creating an object in the .cpp file? Thanks, Daniel Obseve everything, remember more...
Check this: http://www.gotw.ca/gotw/066.htm Tomasz Sowinski -- http://www.shooltz.com
- It's for protection
- Protection from what? Zee Germans? -
Check this: http://www.gotw.ca/gotw/066.htm Tomasz Sowinski -- http://www.shooltz.com
- It's for protection
- Protection from what? Zee Germans?