---
name: "std::out_of_range"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::out_of_range/3cxx"
---

# std::out\_of\_range(3cxx)

## NAME

std::out\_of\_range

## SYNOPSIS

`#include <stdexcept>`

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

### Public Member Functions

**out\_of\_range** (const char \*) \_GLIBCXX\_TXN\_SAFE\
 **out\_of\_range** (const **out\_of\_range** &)=**default**\
 **out\_of\_range** (const **string** &\_\_arg) \_GLIBCXX\_TXN\_SAFE\
 **out\_of\_range** (**out\_of\_range** &&)=**default**\
 **out\_of\_range** & **operator=** (const **out\_of\_range** &)=**default**\
 **out\_of\_range** & **operator=** (**out\_of\_range** &&)=**default**\
 **virtual** const char \* **what** () const noexcept\

## Detailed Description

This represents an argument whose value is not within the expected range (e.g., boundary checks in basic\_string). \

## 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**.

## Author

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