Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When would I use uncaught_exception?

What is a good use case for uncaught_exception?

like image 939
paxos1977 Avatar asked Nov 08 '08 21:11

paxos1977


People also ask

What is return type of Uncaught_exception () is?

Return type of uncaught_exception() is bool.

What is STD termination?

std::terminate() is called by the C++ runtime when the program cannot continue for any of the following reasons: 1) an exception is thrown and not caught (it is implementation-defined whether any stack unwinding is done in this case)

How do you handle uncaught exception in C++?

The terminate( ) function If no handler at any level catches the exception, the special library function terminate( ) (declared in the <exception> header) is automatically called. By default, terminate( ) calls the Standard C library function abort( ) , which abruptly exits the program.

What are standard exceptions in C++?

A C++ exception is a response to an exceptional circumstance that arises while a program is running, such as an attempt to divide by zero. Exceptions provide a way to transfer control from one part of a program to another. C++ exception handling is built upon three keywords: try, catch, and throw.


1 Answers

Herb Sutter seems to give good advice here. He doesn't know of a good use for it and says that some cases where it appears to be useful don't really work.

like image 85
David Norman Avatar answered Sep 23 '22 17:09

David Norman