A RetroSearch Logo

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

Search Query:

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

class

<stdexcept>

std::runtime_error

Runtime error exception


This class defines the type of objects thrown as exceptions to report errors that can only be detected during runtime.

It is used as a base class for several runtime error exceptions, and is defined as:


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

Its sibling class, logic_error, is used as a base for exceptions reporting an error that can be prevented before the program execution.

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 exception.

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)
range_error
Range error exception (class)
overflow_error
Overflow error exception (class)
underflow_error
Underflow error 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