libstdc++: std::logic_error Class Reference

libstdc++

std::logic_error Class Reference
Diagnostics » Exceptions

`#include <stdexcept_except.h>`

Inheritance diagram for std::logic_error:
[legend]

## Public Member Functions
| logic_error (const char *)
| logic_error (const logic_error &) noexcept
| logic_error (const string &__arg)
| logic_error (logic_error &&) noexcept
logic_error & | operator= (const logic_error &) noexcept
logic_error & | operator= (logic_error &&) noexcept
virtual const char * | what () const noexcept

## Detailed Description

One of two subclasses of exception.

Logic errors represent problems in the internal logic of a program; in theory, these are preventable, and even detectable before the program runs (e.g., violations of class invariants).

Definition at line 255 of file stdexcept_except.h.

## Constructor & Destructor Documentation

## ◆ logic_error()

std::logic_error::logic_error | ( | const string & | __arg | ) |
| explicit

Takes a character string describing the error.

References logic_error().

Referenced by logic_error().

## Member Function Documentation

## ◆ what()

virtual const char * std::logic_error::what | ( |  | ) | const
| virtualnoexcept

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::future_error.

References what().

Referenced by what().

The documentation for this class was generated from the following file:

- stdexcept_except.h