std::bad_exception
cppreference.com
<tbody>
</tbody>
class bad_exception; |
||
std::bad_exception , C++ :
|
( C++11) |
|
( C++17) |
-
bad_exception (public -) | |
| (public -) | |
[virtual] |
(virtual public -) |
std::exception
-
[virtual] |
(virtual public of std::exception -)
|
[virtual] |
(virtual public of std::exception -)
|
C++14 ( ).
#include <iostream>
#include <exception>
#include <stdexcept>
void my_unexp()
{
throw;
}
// C++11
void test() throw(std::bad_exception)
{
throw std::runtime_error("");
}
int main()
{
// C++11, C++17
std::set_unexpected(my_unexp);
try {
test();
} catch(const std::bad_exception& e)
{
std::cerr << " " << e.what() << '\n';
}
}
:
std::bad_exception