Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiler independent class name

I need to print the name of a class such as

template<typename... Args>
struct S{};

Using typeid(S<int,std::vector<double>>).name() its fairly simple to print something representative. With boost demangle it might even be readable on gcc.

Is there any way to get the name so the name is the same between different compilers?

like image 929
Bomaz Avatar asked Oct 16 '22 09:10

Bomaz


1 Answers

Not really. The mangled name is, in general, compiler-specific. See the table titled "How different compilers mangle the same functions" on Wikipedia

like image 96
Marshall Clow Avatar answered Oct 30 '22 14:10

Marshall Clow