📜  cpp 获取异常类型 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:32.548000             🧑  作者: Mango

代码示例1
#include 
#include 

const char* currentExceptionTypeName()
{
    int status;
    return abi::__cxa_demangle(abi::__cxa_current_exception_type()->name(), 0, 0, &status);
}

int main()
{
    try {
        throw std::string();
    } catch (...) {
        std::cout<<"Type of caught exception is "<