Difference between revisions of "cpp/experimental/optional/bad optional access"
From cppreference.com
< cpp | experimental | optional
m (Use since= and until= params of {{ddcl}} template.) |
m (cpp/utility/optional -> cpp/experimental/optional) |
||
Line 1: | Line 1: | ||
{{cpp/title | bad_optional_access}} | {{cpp/title | bad_optional_access}} | ||
{{cpp/error/domain_error/navbar}} | {{cpp/error/domain_error/navbar}} | ||
− | {{ddcl | header=optional | since= | + | {{ddcl | header=optional | since=libfund_ts | |
class bad_optional_access; | class bad_optional_access; | ||
}} | }} | ||
− | Defines a type of object to be thrown as exception when accessing a {{lc|std::optional}} object with uninitialized state. | + | Defines a type of object to be thrown as exception when accessing a {{lc|std::experimental::optional}} object with uninitialized state. |
{{inheritance diagram/std-bad_optional_access}} | {{inheritance diagram/std-bad_optional_access}} | ||
Line 16: | Line 16: | ||
{{member | {{small|std::bad_optional_access::}}bad_optional_access | 2= | {{member | {{small|std::bad_optional_access::}}bad_optional_access | 2= | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl | num=1 | since= | + | {{dcl | num=1 | since=libfund_ts | |
explicit bad_optional_access( const std::string& what_arg ); | explicit bad_optional_access( const std::string& what_arg ); | ||
}} | }} | ||
− | {{dcl | num=2 | since= | + | {{dcl | num=2 | since=libfund_ts | |
explicit bad_optional_access( const char* what_arg ); | explicit bad_optional_access( const char* what_arg ); | ||
}} | }} |
Revision as of 17:39, 16 March 2014
Template:cpp/error/domain error/navbar
Defined in header <optional>
|
||
class bad_optional_access; |
(library fundamentals TS) | |
Defines a type of object to be thrown as exception when accessing a std::experimental::optional object with uninitialized state.
Inheritance diagram
Contents |
Member functions
std::bad_optional_access::bad_optional_access
explicit bad_optional_access( const std::string& what_arg ); |
(1) | (library fundamentals TS) |
explicit bad_optional_access( const char* what_arg ); |
(2) | (library fundamentals TS) |
Constructs the exception object with what_arg
as explanatory string that can be accessed through what().
Parameters
what_arg | - | explanatory string |
Exceptions
(none)
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 )
|