Hi all,
Are there any benefits for using exceptions specifications ?
Printable View
Hi all,
Are there any benefits for using 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.
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.