Ans: A
Special functions
The exception handling mechanism relies on two functions, terminate() and unexpected(), for coping with errors related to the exception handling mechanism itself.
void terminate()
The function std::terminate() is called:
-
If an exception is thrown but not caught.
-
If the exception handling mechanism finds that the stack is corrupted.
-
If a destructor propagates an exception during stack unwinding due to another exception (i.e. if a destructor throws while uncaught_exception() is true).
The function terminate() calls teminate_handler() which by default calls abort(). The behaviour of terminate() can be altered by supplying a function pointer to set_terminate().
void unexpected()
If a function throws an exception not allowed by its exception specification (see below) then:
The function unexpected() calls unexpected_handler() which by default calls terminate(). The behaviour of unexpected() can be altered by supplying a function pointer to set_unexpected().
ref: https://accu.org/index.php/journals/513