std::bad_optional_access

std::bad_optional_access

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.

cpp/error/exceptionstd-bad optional access-inheritance-lwg2806.svg

Inheritance diagram.

Member functions

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

Inherited from std::exception

Member functions

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

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/utility/optional/bad_optional_access

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部