Specifying which exceptions can be thrown by a function seems like a good idea.
It can enable the compiler to verify that no other exception is being thrown, and generate more optimal code based on this knowledge.
However, C++ defers those verification to be done at runtime instead of compile-time.
When the verification fails, <code>std::unexpected()</code> is called and the program is likely to be terminated.
<p>The following code illustrates this rule:</p>
void f() throw();
void f() throw()
std::cout << "Hello, world!" << std::endl;