[CMAKE]
[reactos.git] / include / c++ / exception
1 // Exception Handling support header for -*- C++ -*-
2
3 #ifndef __EXCEPTION__
4 #define __EXCEPTION__
5
6 extern "C++" {
7
8 namespace std
9 {
10 /**
11 * @defgroup exceptions Exceptions
12 * @ingroup diagnostics
13 *
14 * Classes and functions for reporting errors via exception classes.
15 * @{
16 */
17
18 /**
19 * @brief Base class for all library exceptions.
20 *
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).
25 */
26 class exception
27 {
28 public:
29 exception() throw() { }
30 virtual ~exception() throw();
31
32 /** Returns a C-style character string describing the general cause
33 * of the current error. */
34 virtual const char* what() const throw();
35 };
36
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
40 {
41 public:
42 bad_exception() throw() { }
43
44 virtual ~bad_exception() throw();
45
46 virtual const char* what() const throw();
47 };
48
49 typedef void (*unexpected_handler) ();
50
51 unexpected_handler set_unexpected(unexpected_handler) throw();
52
53 DECLSPEC_NORETURN void unexpected();
54
55 bool uncaught_exception() throw();
56
57 // @} group exceptions
58 } // namespace std
59
60 typedef void (*terminate_handler) ();
61 terminate_handler set_terminate(terminate_handler) throw();
62 DECLSPEC_NORETURN void terminate() throw();
63
64 } // extern "C++"
65
66 #endif