Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception Specification

I know that this feature will be deprecated in C++0x, but for me as a total novice it seems like a good idea to have it. Could anyone explain to me why isn't a good idea?

like image 770
There is nothing we can do Avatar asked Mar 23 '10 16:03

There is nothing we can do


People also ask

What is meant by exception specification question?

Explanation: C++ provides a mechanism to ensure that a given function is limited to throwing only a specified list of exceptions. It is called an exception specification.

What is Rethrowing an exception means in C++?

If a catch block cannot handle the particular exception it has caught, you can rethrow the exception. The rethrow expression ( throw without assignment_expression) causes the originally thrown object to be rethrown.

What does Noexcept mean?

The noexcept operator performs a compile-time check that returns true if an expression is declared to not throw any exceptions. It can be used within a function template's noexcept specifier to declare that the function will throw exceptions for some types but not others.


1 Answers

Please see this detailed article by Herb Sutter. He has the most thorough explanation of the problems and short comings of their design.

A Pragmatic Look at Exception Specificiations

  • http://www.gotw.ca/publications/mill22.htm
like image 157
JaredPar Avatar answered Sep 18 '22 10:09

JaredPar