First page Back Continue Last page Graphics
Exceptions in Classes
In addition to a function, an exception can be part of a class design.
- class problem { ... };
- ...
- void super( ) throw ( problem & )
- {
- ...
- if(oh_no)
- {
- problem oops( );
- throw oops;
- }
- ...
- try { super( ); }
- catch(problem & p) { ... }