FreeBSD Manual Pages
std::unexpected(3) C++ Standard Libary std::unexpected(3) NAME std::unexpected - std::unexpected Synopsis Defined in header <exception> void unexpected(); (until C++11) (since C++11) [[noreturn]] void unexpected(); (deprecated) (removed in C++17) std::unexpected() is called by the C++ runtime when a dynamic excep- tion 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 unexpected being called, the handler that was installed at the end of the throw expression is the one that (until C++11) will be called. (note: it was ambiguous whether re-throwing applied the new handlers) If a destructor reset the unexpected handler during stack unwinding, it is unspecified which handler is called if the unwinding later led (since C++11) to unexpected being called. Parameters (none) Return value (none) Exceptions Throw any exception thrown by the currently installed std::unex- pected_handler Defect reports The following behavior-changing defect reports were applied retroac- tively to previously published C++ standards. DR Applied to Behavior as published Correct behavior effect of calling set_unexpected during stack LWG 2111 C++11 unwinding differs from C++98 and breaks some made unspecified ABIs See also unexpected represented as an unexpected value in expected (C++23) (class template) unexpected_handler the type of the function called by std::unex- pected (removed in C++17) (typedef) http://cppreference.com 2022.07.31 std::unexpected(3)
NAME | Synopsis | Parameters | Return value | Exceptions | See also
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::unexpected&sektion=3&manpath=FreeBSD+Ports+15.0>
