Defined in header <exception> | ||
---|---|---|
void unexpected(); | (until C++11) | |
[[noreturn]] void unexpected(); | (until C++17) (since c++11, deprecated in C++11) |
std::unexpected()
is called by the C++ runtime when a dynamic exception specification is violated: an exception is thrown from a function whose exception specification forbids exceptions of this type.
std::unexpected()
may also be called directly from the program.
In either case, std::unexpected
calls the currently installed std::unexpected_handler
. The default std::unexpected_handler
calls std::terminate
.
If a destructor reset the unexpected handler during stack unwinding and the unwinding later led to | (until C++11) |
If a destructor reset the unexpected handler during stack unwinding, it is unspecified which handler is called if the unwinding later led to | (since C++17) |
(none).
(none).
Throw any exception thrown by the currently installed std::unexpected_handler
.
(until C++17) | the type of the function called by std::unexpected (typedef) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/error/unexpected