|
327 | 327 | it is rethrown.
|
328 | 328 | \end{note}
|
329 | 329 |
|
| 330 | +\pnum |
| 331 | +An exception is considered uncaught |
| 332 | +after completing the initialization of the exception object |
| 333 | +until completing the activation of a handler for the exception\iref{except.handle}. |
| 334 | +\begin{note} |
| 335 | +As a consequence, an exception is considered uncaught |
| 336 | +during any stack unwinding resulting from it being thrown. |
| 337 | +\end{note} |
| 338 | + |
| 339 | +\pnum |
| 340 | +If an exception is rethrown\iref{expr.throw,propagation}, |
| 341 | +it is considered uncaught from the point of rethrow |
| 342 | +until the rethrown exception is caught. |
| 343 | +\indexlibraryglobal{uncaught_exceptions}% |
| 344 | +\begin{note} |
| 345 | +The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} |
| 346 | +returns the number of uncaught exceptions in the current thread. |
| 347 | +\end{note} |
| 348 | + |
330 | 349 | \pnum
|
331 | 350 | \indextext{exception handling!terminate called@\tcode{terminate} called}%
|
332 | 351 | \indextext{\idxcode{terminate}!called}%
|
333 | 352 | If the exception handling mechanism
|
334 |
| -handling an uncaught exception\iref{except.uncaught} |
| 353 | +handling an uncaught exception |
335 | 354 | directly invokes a function that exits via an
|
336 | 355 | exception, the function \tcode{std::terminate} is invoked\iref{except.terminate}.
|
337 | 356 | \begin{example}
|
|
1007 | 1026 | The function \tcode{std::terminate}\iref{except.terminate}
|
1008 | 1027 | is used by the exception
|
1009 | 1028 | handling mechanism for coping with errors related to the exception handling
|
1010 |
| -mechanism itself. The function |
1011 |
| -\tcode{std::current_exception()}\iref{propagation} and the class |
| 1029 | +mechanism itself. |
| 1030 | +The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} |
| 1031 | +reports how many exceptions are uncaught in the current thread. |
| 1032 | +The function \tcode{std::current_exception}\iref{propagation} and the class |
1012 | 1033 | \tcode{std::nested_exception}\iref{except.nested} can be used by a program to
|
1013 | 1034 | capture the currently handled exception.
|
1014 | 1035 |
|
|
1132 | 1153 | prematurely based on a determination that the unwind process
|
1133 | 1154 | will eventually cause an invocation of the function
|
1134 | 1155 | \tcode{std::terminate}.
|
1135 |
| - |
1136 |
| -\rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions} function}% |
1137 |
| -\indexlibraryglobal{uncaught_exceptions} |
1138 |
| - |
1139 |
| -\pnum |
1140 |
| -An exception is considered uncaught |
1141 |
| -after completing the initialization of the exception object\iref{except.throw} |
1142 |
| -until completing the activation of a handler for the exception\iref{except.handle}. |
1143 |
| -\begin{note} |
1144 |
| -As a consequence, an exception is considered uncaught |
1145 |
| -during any stack unwinding resulting from it being thrown. |
1146 |
| -\end{note} |
1147 |
| -If an exception is rethrown\iref{expr.throw,propagation}, |
1148 |
| -it is considered uncaught from the point of rethrow |
1149 |
| -until the rethrown exception is caught. |
1150 |
| -The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} |
1151 |
| -returns the number of uncaught exceptions in the current thread.% |
1152 | 1156 | \indextext{exception handling|)}
|
0 commit comments