Zero allocation. Returns a string_view into static storage valid for the process lifetime. Replaces the local live_type_name<T>() in LiveArena.hpp.
29{
30#if defined(MAYAFLUX_COMPILER_CLANG)
31 constexpr std::string_view fn = __PRETTY_FUNCTION__;
32 constexpr auto s = fn.find("T = ") + 4;
33 constexpr auto e = fn.rfind(']');
34 return fn.substr(s, e - s);
35#elif defined(MAYAFLUX_COMPILER_GCC)
36 constexpr std::string_view fn = __PRETTY_FUNCTION__;
37 constexpr auto s = fn.find("T = ") + 4;
38 constexpr auto e = fn.find(';', s);
39 return (e != std::string_view::npos) ? fn.substr(s, e - s) : fn.substr(s);
40#elif defined(MAYAFLUX_COMPILER_MSVC)
41 constexpr std::string_view fn = __FUNCSIG__;
42 constexpr auto s = fn.find("type_name<") + 10;
43 constexpr auto e = fn.rfind(">(");
44 return (e != std::string_view::npos && e > s) ? fn.substr(s, e - s) : fn.substr(s);
45#else
46 return "unknown";
47#endif
48}