fork download
  1. #include <cxxabi.h>
  2. #include <iostream>
  3.  
  4. std::string demangle_type(const std::string& mangled)
  5. {
  6. char *demangled = abi::__cxa_demangle(mangled.c_str(), 0, 0, 0);
  7. std::string result {demangled};
  8. free(demangled);
  9. return result;
  10. }
  11.  
  12. int main()
  13. {
  14. using namespace std;
  15.  
  16. cout << demangle_type("3barI5emptyLi17EE") << endl;
  17. }
Success #stdin #stdout 0s 3060KB
stdin
Standard input is empty
stdout
bar<empty, 17>