Technical specifications
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals 2 TS)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Concepts (concepts TS)
Ranges (ranges TS)
Special mathematical functions (special math TR)
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.

cpp/error/exceptioncpp/error/logic errorstd-bad optional access-inheritance.svg

Inheritance diagram

Member functions

constructs the exception object
(public member function)

Inherited from std::exception

Member functions

destroys the exception object
(virtual public member function of std::exception)
returns an explanatory string
(virtual public member function of std::exception)