NOTE The Taligent standard requires that all error conditions in the Taligent Application Environment be reported through exceptions, not through error codes.
Destructors
Do not throw exceptions in destructors, and do not call anything that might throw an exception unless you're prepared to catch it and deal with it (see the next section, "When to recover an exception"). Destructors that exit with an exception never finish executing, and the uncleaned resources are lost.
Additionally, the ISO/ANSI draft standard states that if the exit occurs during a stack unwind (while handling an exception), and while searching for an exception handler, the special function
terminate()
is called. As you might gather from the name, terminate()
takes rather draconian measures. Although you can install your own terminate function instead, it cannot be done in a clean way by library software, but must instead be left to the application developer.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.