Consider the following code:
class A
{
public:
virtual void f() throw ( int ) { }
};
class B: public A
{
public:
void f() throw ( int, double ) { }
};
When compiled, it says that derived class B has a looser throw specifier compared to A. What is the importance of this? If we try to exchange their exception specification, such that A::f() throws int and double while B::f() throws only int, the error does not appear.
To expand on point 2:
A‘s callers expect that onlyintcomes out, but if you use aB(which, because it’s publicly derived fromA, also means it’s usable as anA), suddenlydoublecan come out too, and that would breakA‘s contract (that onlyintgets thrown).