U
usenet
I am trying to collect a comprehensive listing of standard C++
exceptions. This is what I have got so far (by going through the
standard). Kindly let me know if I missed anything.
Thanks,
Ramesh
//
// ********* Derived from std::exception *********
//
class bad_alloc; // thrown to report a failure to allocate storage
class bad_cast; // thrown to report an invalid dynamic cast
expression
class bad_typeid; // thrown to report a null pointer in a typeid
expression
class bad_exception; // thrown when an exception type doesn't match
any catch
class logic_error(const string& what_arg); // thrown to report
errors presumably
// detectable before the
program
// executes, such as
violations of
// logical preconditions or
// class invariants
class runtime_error(const string& what_arg); // thrown to report
errors presumably
// detectable only when
the program
// executes
class ios_base::failure(const string& msg); // thrown by functions
in the iostreams
// library, to report
errors detected during
// stream buffer
operations.
//
// ********* Derived from logic_error *********
//
class domain_error(const string& what_arg); // thrown to report
domain errors
class invalid_argument(const string& what_arg); // thrown to report an
invalid argument
class length_error(const string& what_arg); // thrown to report an
attempt to produce
// an object whose
length exceeds its
// maximum allowable
size
class out_of_range(const string& what_arg); // thrown to report an
argument value not in
// its expected range
//
// ********* Derived from runtime_error *********
//
class range_error(const string& what_arg); // thrown to report
range errors in
// internal
computations
class overflow_error(const string& what_arg); // thrown to report an
arithmetic overflow error
class underflow_error(const string& what_arg); // thrown to report an
arithmetic underflow error
exceptions. This is what I have got so far (by going through the
standard). Kindly let me know if I missed anything.
Thanks,
Ramesh
//
// ********* Derived from std::exception *********
//
class bad_alloc; // thrown to report a failure to allocate storage
class bad_cast; // thrown to report an invalid dynamic cast
expression
class bad_typeid; // thrown to report a null pointer in a typeid
expression
class bad_exception; // thrown when an exception type doesn't match
any catch
class logic_error(const string& what_arg); // thrown to report
errors presumably
// detectable before the
program
// executes, such as
violations of
// logical preconditions or
// class invariants
class runtime_error(const string& what_arg); // thrown to report
errors presumably
// detectable only when
the program
// executes
class ios_base::failure(const string& msg); // thrown by functions
in the iostreams
// library, to report
errors detected during
// stream buffer
operations.
//
// ********* Derived from logic_error *********
//
class domain_error(const string& what_arg); // thrown to report
domain errors
class invalid_argument(const string& what_arg); // thrown to report an
invalid argument
class length_error(const string& what_arg); // thrown to report an
attempt to produce
// an object whose
length exceeds its
// maximum allowable
size
class out_of_range(const string& what_arg); // thrown to report an
argument value not in
// its expected range
//
// ********* Derived from runtime_error *********
//
class range_error(const string& what_arg); // thrown to report
range errors in
// internal
computations
class overflow_error(const string& what_arg); // thrown to report an
arithmetic overflow error
class underflow_error(const string& what_arg); // thrown to report an
arithmetic underflow error