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

# std::bad\_any\_cast(3cxx)

Exception class thrown by a failed any\_cast.

## NAME

std::bad\_any\_cast - Exception class thrown by a failed `any_cast`.

## SYNOPSIS

`#include <any>`

Inherits **std::bad\_cast**.

### Public Member Functions

**virtual** const char \* **what** () const noexcept\

## Detailed Description

Exception class thrown by a failed `any_cast`.

## Member Function Documentation

### virtual const char \* std::bad\_any\_cast::what () const` [inline]`, ` [virtual]`, ` [noexcept]`

Returns a C-style character string describing the general cause of the current error. \

Reimplemented from **std::bad\_cast**.

## Author

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