Standard C++ Library Reference ISO/IEC (VERSION3)
Next
<stdexcept>
Include the standard header <stdexcept> to define several classes used for reporting
exceptions. The classes form a derivation hierarchy, as indicated by the indenting above, all
derived from class exception.
namespace std {
class logic_error;
class domain_error;
class invalid_argument;
class length_error;
class out_of_range;
class runtime_error;
class range_error;
class overflow_error;
class underflow_error;
};
domain_error
class domain_error : public logic_error {
public:
domain_error(const string& message);
};
The class serves as the base class for all exceptions thrown to report a domain error. The value
returned by what() is a copy of message.data().
invalid_argument
class invalid_argument : public logic_error {
public:
invalid_argument(const string& message);
};
The class serves as the base class for all exceptions thrown to report an invalid argument. The
value returned by what() is a copy of message.data().