1 // Exception Handling support header for -*- C++ -*-
11 * @defgroup exceptions Exceptions
12 * @ingroup diagnostics
14 * Classes and functions for reporting errors via exception classes.
19 * @brief Base class for all library exceptions.
21 * This is the base class for all exceptions thrown by the standard
22 * library, and by certain language expressions. You are free to derive
23 * your own %exception classes, or use a different hierarchy, or to
24 * throw non-class data (e.g., fundamental types).
29 exception() throw() { }
30 virtual ~exception() throw();
32 /** Returns a C-style character string describing the general cause
33 * of the current error. */
34 virtual const char* what() const throw();
37 /** If an %exception is thrown which is not listed in a function's
38 * %exception specification, one of these may be thrown. */
39 class bad_exception : public exception
42 bad_exception() throw() { }
44 virtual ~bad_exception() throw();
46 virtual const char* what() const throw();
49 typedef void (*unexpected_handler) ();
51 unexpected_handler set_unexpected(unexpected_handler) throw();
53 __MINGW_ATTRIB_NORETURN void unexpected();
55 bool uncaught_exception() throw();
57 // @} group exceptions
60 typedef void (*terminate_handler) ();
61 terminate_handler set_terminate(terminate_handler) throw();
62 __MINGW_ATTRIB_NORETURN void terminate() throw();