-
February 5th, 2009, 10:17 AM
#1
[RESOLVED] why do I need exceptions specifications
Hi all,
Are there any benefits for using exceptions specifications ?
-
February 5th, 2009, 10:23 AM
#2
Re: why do I need exceptions specifications
Some words from Herb Sutter about it.
http://www.gotw.ca/publications/mill22.htm
Moral #1: Never write an exception specification. Moral #2: Except possibly an empty one, but if I were you I’d avoid even that.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
February 5th, 2009, 10:25 AM
#3
Re: why do I need exceptions specifications
None whatsoever, in fact quite the opposite.
Violation of an exception specification causes std::terminate to be called which immediately calls std::abort exiting your program without any cleanup whatsoever, possibly leaving files for instance in a complete state of disrepair.
You are probably best off forgetting they even exist.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|