A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/stdexcept/domain_error/ below:

class

<stdexcept>

std::domain_error

Domain error exception


This class defines the type of objects thrown as exceptions to report domain errors.

Generally, the domain of a mathematical function is the subset of values that it is defined for. For example, the square root function is only defined for non-negative numbers. Thus, a negative number for such a function would qualify as a domain error.

No component of the standard library throws exceptions of this type. It is designed as a standard exception to be thrown by programs.

1
2
3
4
class domain_error : public logic_error {
public:
  explicit domain_error (const string& what_arg);
};
1
2
3
4
5
class domain_error : public logic_error {
public:
  explicit domain_error (const string& what_arg);
  explicit domain_error (const char* what_arg);
};


Members
constructor
The string passed as what_arg has the same content as the value returned by member what.

The class inherits the what member function from logic_error.

Exception safetyStrong guarantee: if the constructor throws an exception, there are no side effects.

See also
exception
Standard exception class (class)
logic_error
Logic error exception (class)
runtime_error
Runtime error exception (class)
invalid_argument
Invalid argument exception (class)
length_error
Length error exception (class)
out_of_range
Out-of-range exception (class)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4