1.

Solve : Exceptions?

Answer»

Does anybody know where I can find a list of exceptions included naturally in C++? I know OutOfMemory is one of them. I've been looking on the net for a while now.

EDIT: Is this really all of them?

Quote

    * std::bad_alloc - thrown by the new operator when memory allocation fails.
    * std::bad_cast - as above.
    * std::bad_typeid - as above.
    * std::logic_error - base class for std::domain_error, std::invalid_argument, std::length_error and std::out_of_range.
    * std::domain_error - not sure what this is for.
    * std::invalid_argument - does exactly what is says on the tin.
    * std::length_error - thrown when container CLASSES get too BIG, such as APPENDING too many characters to a string.
    * std::out_of_range - thrown by the container classes when ACCESSING a value at the wrong index.
    * std::ios_base::failure - thrown when an IO operation fails.
    * std::runtime_error - base class for std::range_error, std::overflow_error and std::underflow_error.
    * std::range_error - thrown when internal range calculations fail - such as when using unrelated iterators.
    * std::overflow_error - thrown when a numeric value cannot get any LARGER.
    * std::underflow_error - thrown when a numeric value cannot get any smaller.


Discussion

No Comment Found