\r
extern "C++" {\r
\r
-namespace std\r
+class exception\r
{\r
- /**\r
- * @defgroup exceptions Exceptions\r
- * @ingroup diagnostics\r
- *\r
- * Classes and functions for reporting errors via exception classes.\r
- * @{\r
- */\r
+public:\r
+ exception() throw();\r
+ exception(const char * const &) throw();\r
+ exception(const char * const &, int) throw();\r
\r
- /**\r
- * @brief Base class for all library exceptions.\r
- *\r
- * This is the base class for all exceptions thrown by the standard\r
- * library, and by certain language expressions. You are free to derive\r
- * your own %exception classes, or use a different hierarchy, or to\r
- * throw non-class data (e.g., fundamental types).\r
- */\r
- class exception\r
- {\r
- public:\r
- exception() throw() { }\r
virtual ~exception() throw();\r
\r
- /** Returns a C-style character string describing the general cause\r
- * of the current error. */\r
- virtual const char* what() const throw();\r
- };\r
-\r
- /** If an %exception is thrown which is not listed in a function's\r
- * %exception specification, one of these may be thrown. */\r
- class bad_exception : public exception\r
- {\r
- public:\r
- bad_exception() throw() { }\r
+ virtual const char *what() const throw();\r
+private:\r
+ const char *_name;\r
+ int _do_free;\r
+};\r
\r
- virtual ~bad_exception() throw();\r
+class bad_exception : public exception\r
+{\r
+public:\r
+ bad_exception(const char *name = "bad exception") throw()\r
+ : exception(name) { }\r
\r
- virtual const char* what() const throw();\r
- };\r
+ virtual ~bad_exception() throw() { }\r
+};\r
\r
- typedef void (*unexpected_handler) ();\r
+namespace std\r
+{\r
+ using ::exception;\r
+ using ::bad_exception;\r
\r
- unexpected_handler set_unexpected(unexpected_handler) throw();\r
+ typedef void (*unexpected_handler) ();\r
\r
- __MINGW_ATTRIB_NORETURN void unexpected();\r
+ unexpected_handler set_unexpected(unexpected_handler) throw();\r
\r
- bool uncaught_exception() throw();\r
+ __MINGW_ATTRIB_NORETURN void unexpected();\r
\r
- // @} group exceptions\r
+ bool uncaught_exception() throw();\r
} // namespace std\r
\r
typedef void (*terminate_handler) ();\r