W
Wat
1. Is this correct in C++?
int foo() throw(); // can not throw any exception
int foo(); // can throw any exception
2. Exception specification:
int foo() throw(type list);
For example, void foo() throw(int, over_flow);
Should two catch blocks built to catch "int" and "over_flow" separately? Or
just one block of catch, which catches both "int" and "over_flow"?
3. If "int foo() throw();" does mean "can not throw any exception", then
what happens if an exception do occur inside foo()?
4. Does the above exception specification also apply to memeber functions of
classes?
Thanks for your help!
int foo() throw(); // can not throw any exception
int foo(); // can throw any exception
2. Exception specification:
int foo() throw(type list);
For example, void foo() throw(int, over_flow);
Should two catch blocks built to catch "int" and "over_flow" separately? Or
just one block of catch, which catches both "int" and "over_flow"?
3. If "int foo() throw();" does mean "can not throw any exception", then
what happens if an exception do occur inside foo()?
4. Does the above exception specification also apply to memeber functions of
classes?
Thanks for your help!