stdexcept.h revision 227825
1227825Stheraven/** 2227825Stheraven * stdexcept.h - provides a stub version of <stdexcept>, which defines enough 3227825Stheraven * of the exceptions for the runtime to use. 4227825Stheraven */ 5227825Stheraven 6227825Stheravennamespace std 7227825Stheraven{ 8227825Stheraven 9227825Stheraven class exception 10227825Stheraven { 11227825Stheraven public: 12227825Stheraven exception() throw(); 13227825Stheraven exception(const exception&) throw(); 14227825Stheraven exception& operator=(const exception&) throw(); 15227825Stheraven virtual ~exception(); 16227825Stheraven virtual const char* what() const throw(); 17227825Stheraven }; 18227825Stheraven 19227825Stheraven 20227825Stheraven /** 21227825Stheraven * Bad allocation exception. Thrown by ::operator new() if it fails. 22227825Stheraven */ 23227825Stheraven class bad_alloc: public exception 24227825Stheraven { 25227825Stheraven public: 26227825Stheraven bad_alloc() throw(); 27227825Stheraven bad_alloc(const bad_alloc&) throw(); 28227825Stheraven bad_alloc& operator=(const bad_alloc&) throw(); 29227825Stheraven ~bad_alloc(); 30227825Stheraven virtual const char* what() const throw(); 31227825Stheraven }; 32227825Stheraven 33227825Stheraven /** 34227825Stheraven * Bad cast exception. Thrown by the __cxa_bad_cast() helper function. 35227825Stheraven */ 36227825Stheraven class bad_cast: public exception { 37227825Stheraven public: 38227825Stheraven bad_cast() throw(); 39227825Stheraven bad_cast(const bad_cast&) throw(); 40227825Stheraven bad_cast& operator=(const bad_cast&) throw(); 41227825Stheraven virtual ~bad_cast(); 42227825Stheraven virtual const char* what() const throw(); 43227825Stheraven }; 44227825Stheraven 45227825Stheraven /** 46227825Stheraven * Bad typeidexception. Thrown by the __cxa_bad_typeid() helper function. 47227825Stheraven */ 48227825Stheraven class bad_typeid: public exception 49227825Stheraven { 50227825Stheraven public: 51227825Stheraven bad_typeid() throw(); 52227825Stheraven bad_typeid(const bad_typeid &__rhs) throw(); 53227825Stheraven virtual ~bad_typeid(); 54227825Stheraven bad_typeid& operator=(const bad_typeid &__rhs) throw(); 55227825Stheraven virtual const char* what() const throw(); 56227825Stheraven }; 57227825Stheraven 58227825Stheraven 59227825Stheraven 60227825Stheraven} // namespace std 61227825Stheraven 62