Created
July 28, 2019 18:51
-
-
Save hmenn/bc1554d863f6ca99b5fe6b1e5f99dc60 to your computer and use it in GitHub Desktop.
c++ mangling demangling example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <typeinfo> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <cxxabi.h> | |
struct A{ | |
std::vector<int> a; | |
}; | |
int main(){ | |
std::cout<<typeid(A::a).name()<<std::endl; | |
std::cout<<typeid(&A::a).name()<<std::endl; | |
int status; | |
std::cout<< abi::__cxa_demangle(typeid(A::a).name(), nullptr, 0, &status)<<std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment