std::bad_optional_access
From cppreference.com
                    
                                        
                    
                    
                                                            
                    |   Defined in header  <optional>
  | 
||
|   class bad_optional_access;  | 
(since C++17) | |
Defines a type of object to be thrown by std::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
|    [virtual]  | 
  destroys the exception object  (virtual public member function of std::exception)  | 
|    [virtual]  | 
   returns an explanatory string  (virtual public member function of std::exception)  |