JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: C++ User's Guide     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information


Part I C++ Compiler

1.  The C++ Compiler

2.  Using the C++ Compiler

3.  Using the C++ Compiler Options

Part II Writing C++ Programs

4.  Language Extensions

5.  Program Organization

6.  Creating and Using Templates

7.  Compiling Templates

8.  Exception Handling

8.1 Synchronous and Asynchronous Exceptions

8.2 Specifying Runtime Errors

8.3 Disabling Exceptions

8.4 Using Runtime Functions and Predefined Exceptions

8.5 Mixing Exceptions With Signals and Setjmp/Longjmp

8.6 Building Shared Libraries That Have Exceptions

9.  Improving Program Performance

10.  Building Multithreaded Programs

Part III Libraries

11.  Using Libraries

12.  Using the C++ Standard Library

13.  Using the Classic iostream Library

14.  Building Libraries

Part IV Appendixes

A.  C++ Compiler Options

B.  Pragmas



8.1 Synchronous and Asynchronous Exceptions

Exception handling is intended to support only synchronous exceptions, such as array range checks. The term synchronous exception means that exceptions can be originated only from throw expressions.

The C++ standard supports synchronous exception handling with a termination model. Termination means that once an exception is thrown, control never returns to the throw point.

Exception handling is not intended to directly handle asynchronous exceptions such as keyboard interrupts. However, you can make exception handling work in the presence of asynchronous events if you are careful. For instance, to make exception handling work with signals, you can write a signal handler that sets a global variable, and create another routine that polls the value of that variable at regular intervals and throws an exception when the value changes. You cannot throw an exception from a signal handler.