---
name: "std::length_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::length_error"
---

# std::length\_error(3)

## NAME

std::length\_error

## SYNOPSIS

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

Inherits **std::logic\_error**.

### Public Member Functions

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

## Detailed Description

Thrown when an object is constructed that would exceed its maximum permitted size (e.g., a basic\_string instance).

## Member Function Documentation

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

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()**.

## Author

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