Developer Documentation

TypeName.hh
1 #pragma once
2
3 #include <string>
4 #include <typeinfo>
5
10 template<typename T>
11 inline std::string get_type_name()
12 {
13 #ifdef _MSC_VER
14 // MSVC's type_name only returns a friendly name with .name(),
15 // get the more unique mangled name using .raw_name():
16 return typeid(T).raw_name();
17 #else
18 // GCC and clang currently return the mangled name as .name(),
19 // there is no .raw_name()
20 return typeid(T).name();
21 #endif
22 }
23