[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/error/bad_exception [Back]  [Original]

std::bad_exception cppreference.com
cppreference.com

std::bad_exception

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
 
 
 
<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

Web Proxy Viewer  |  New URL  |  Original Page