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?
Not really. The mangled name is, in general, compiler-specific. See the table titled "How different compilers mangle the same functions" on Wikipedia
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With