Skip to content

Instantly share code, notes, and snippets.

@hmenn
Created July 28, 2019 18:51
Show Gist options
  • Save hmenn/bc1554d863f6ca99b5fe6b1e5f99dc60 to your computer and use it in GitHub Desktop.
Save hmenn/bc1554d863f6ca99b5fe6b1e5f99dc60 to your computer and use it in GitHub Desktop.
c++ mangling demangling example
#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