What is the point of `void func() throw(type)`?

c++, standards, throw

Solution

That is an exception specification, and it is almost certainly a bad idea.

It states that `func` may throw a `std::exception`, and any other exception that `func` emits will result in a call to `unexpected()`.

Problem

I know this is a valid c++ program. What is the point of the throw in the function declarement? AFAIK it does nothing and isnt used for anything. ``` #include <exception> void func() throw(std::exception) { } int main() { return 0; } ```

Original source