# std::experimental::bad_optional_access

From cppreference.com
< cpp‎ | experimental‎ | optional

Defined in header `<experimental/optional>` |  |
class bad_optional_access; |  | (library fundamentals TS)

Defines a type of object to be thrown by `std::experimental::optional::value` when accessing an optional object that does not contain a value.

Inheritance diagram

### Member functions

(constructor) | constructs the exception object (public member function)

## Inherited from std::exception

### Member functions

(destructor) [virtual] | destroys the exception object (virtual public member function of `std::exception`)
what [virtual] | returns an explanatory string (virtual public member function of `std::exception`)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/optional/bad_optional_access&oldid=80194"