|
From: Gabriel D. R. <Gab...@cm...> - 2000-08-23 23:36:43
|
"Christophe Prud'homme" <pru...@MI...> writes:
| YAROGT again!
|
| I cannot verify this in a C++ textbook/reference, I don't have one handy
| but
|
| say that we have
| class A
| {
| public:
| virtual void f() throw(exceptA);
| }
|
| class B : public A
| {
| public:
|
| // f redefined
| void f(); // is it ok?
No this is wrong.
| void f() throw(exceptA); // or is it this one? or both?
This one is OK.
|
| }
|
| it seems that in 2.96 the first one is rejected
| the second one is the correct one
| I would say that the true prototype is the second one
| the first one is another function which does not throw any exceptions
|
| any c++ guru?
I'm not a C++ guru but I'll answer it anyway. Since a virtual
function speficies responsabilities, its overriders cannot safely
allow more exceptions that the initial interface does.
I'd strongly recommand not to use exception-specification -- the
exception (no pun intended) might be throw().
-- Gaby
|