Exception Specifications
Fortunately, our program can gain control by
replacing the call to terminate with a call to a
function that we provide. We pass the address of
our function to the library function
set_unexpected. The following shows the syntax:
void user_unexpected() {       //user supplied function
  ...
}
int main() {
  set_unexpected(user_unexpected); //install user function