First page Back Continue Last page Graphics
13.6 Exception Specifications
List of exceptions function can throw
- Also called throw list
- int someFunction( double value )
- throw ( ExceptionA, ExceptionB, ExceptionC )
- {
// function body
- }
- Can only throw ExceptionA, ExceptionB, and ExceptionC (and derived classes)
- If throws other type, function unexpected called
- By default, terminates program (more 13.7)
- If no throw list, can throw any exception
- If empty throw list, cannot throw any exceptions