std::experimental::bad_optional_access(3)

std::experimental::bad_optional_access3

Exception class thrown when a disengaged optional object is dereferenced.

Usage

#include <optional>

Inherits std::logic_error.

Public Member Functions

bad_optional_access (const char *__arg)
virtual const char * what () const noexcept

Detailed Description

Exception class thrown when a disengaged optional object is dereferenced.

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.

From gcc 16.2.1+r23+gd564253eb6c8-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.