---
name: "std::runtime_error"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::runtime_error"
---

# std::runtime\_error(3)

One of two subclasses of exception.

## NAME

std::runtime\_error - One of two subclasses of exception.

## SYNOPSIS

\#include \<stdexcept\_except.h\>

Inherits **std::exception**.

Inherited by , , **std::overflow\_error**, **std::range\_error**, and **std::regex\_error**.

### Public Member Functions

**runtime\_error** (const char \*)\
 **runtime\_error** (const runtime\_error &) noexcept\
 **runtime\_error** (const **string** &\_\_arg)\
 **runtime\_error** (runtime\_error &&) noexcept\
 **runtime\_error** & **operator=** (const **runtime\_error** &) noexcept\
 **runtime\_error** & **operator=** (**runtime\_error** &&) noexcept\
 virtual const char \* **what** () const noexcept\

## Detailed Description

One of two subclasses of exception.

Runtime errors represent problems outside the scope of a program; they cannot be easily predicted and can generally only be caught as the program executes.

## Constructor & Destructor Documentation

### std::runtime\_error::runtime\_error (const string & \_\_arg) \[explicit\]

Takes a character string describing the error.

References **runtime\_error()**.

Referenced by **runtime\_error()**.

## Member Function Documentation

### virtual const char \* std::runtime\_error::what () const \[virtual\], \[noexcept\]

Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).

Reimplemented from **std::exception**.

Reimplemented in **std::experimental::filesystem::v1::filesystem\_error**, **std::filesystem::filesystem\_error**, and **std::ios\_base::failure**.

References **what()**.

Referenced by **what()**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
