std::bad_optional_access

Header: <optional>

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

# Declarations

class bad_optional_access;

(since C++17)

# Parameters

# Return value

*this

# Notes

Implementations are allowed but not required to override what().