A terminate handler function is a function automatically called when the exception handling process has to be abandoned for some reason. This happens when a handler cannot be found for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the handling process.
The terminate handler by default calls cstdlib's abort function.
Parameters
- f
- Function that takes no parameters and returns void.
The function shall not return and shall terminate the program.
terminate_handler is a function pointer type taking no parameters and returning void.
Return value
The current terminate handler function.terminate_handler is a function pointer type taking no parameters and returning void.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Possible output:
terminate handler called Aborted |
See also
| terminate | Function handling termination on exception (function) |
| terminate_handler | Type of terminate handler function (type) |
| set_unexpected | Set unexpected handler function (function) |
