Hi,
I have read something on IBM's site about exception specification and pointers to functions:
void (*f)();
void (*g)();
void (*h)() throw (int);
void i() {
f = h;
// h = g; This is an error.
}
IBM says:
The compiler allows the assignment f = h because f can throw any kind of exception. The compiler would not allow the assignment h = g because h can only throw objects of type int, while g can throw any kind of exception.
But I tested the code in VC++, DEVC++ and CodeBlocks, no error anywhere.
Any explanations?
Thanks.