Search
 
SCRIPT & CODE EXAMPLE
 

CPP

cpp get exception type

#include <iostream>
#include <cxxabi.h>

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 "<<currentExceptionTypeName()<<std::endl;
    }

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: search by value in map in stl/cpp 
Cpp :: how to reverse a vector in c++ 
Cpp :: cpp linked list 
Cpp :: c++ array pointer 
Cpp :: vector of threads thread pool c++ 
Cpp :: c++ data types 
Cpp :: C++ sum a vector of digits 
Cpp :: how to sort array in c++ stockoverflow 
Cpp :: changing values of mat in opencv c++ 
Cpp :: c++ uint8_t header 
Cpp :: Exit Button c++ code 
Cpp :: sum of first 100 natural numbers 
Cpp :: adddynamic ue4 c++ 
Cpp :: c++ variable type 
Cpp :: how to make loop in c++ 
Cpp :: how to fill vector from inputs c++ 
Cpp :: bubble sort c++ 
Cpp :: c++ program to convert fahrenheit to celsius 
Cpp :: inline function in cpp 
Cpp :: maximum subarray leetcode c++ 
Cpp :: int to string C++ Using stringstream class 
Cpp :: oop in c++ have 5 
Cpp :: c++ define function pointer 
Cpp :: 1. Two Sum 
Cpp :: find second largest number in array c++ 
Cpp :: deque 
Cpp :: c++ overloading by ref-qualifiers 
Cpp :: C++ file . 
Cpp :: remove item from layout 
Cpp :: how to create windows warning message c++ 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =