8#if defined(__clang__
) && defined(__has_include
)
9#if __has_include
(<cxxabi.h>)
12#elif defined(__GLIBCXX__) || defined(__GLIBCPP__)
16#if defined(HAS_CXXABI_H
)
25inline char const* demangle_alloc(
char const* name)
noexcept;
26inline void demangle_free(
char const* name)
noexcept;
34 explicit scoped_demangled_name(
char const* name)
noexcept : m_p(demangle_alloc(name))
37 ~scoped_demangled_name()
noexcept
42 char const* get()
const noexcept
53#if defined(HAS_CXXABI_H
)
55inline char const* demangle_alloc(
char const* name)
noexcept
59 return abi::__cxa_demangle(name, NULL, &size, &status);
62inline void demangle_free(
char const* name)
noexcept
65 std::free(
const_cast<
char*>(name));
85inline std::string demangle(
const std::type_index& index)
87 if(index ==
typeid(std::string))
91 if(index ==
typeid(std::string_view))
93 return "std::string_view";
95 if(index ==
typeid(std::chrono::seconds))
97 return "std::chrono::seconds";
99 if(index ==
typeid(std::chrono::milliseconds))
101 return "std::chrono::milliseconds";
103 if(index ==
typeid(std::chrono::microseconds))
105 return "std::chrono::microseconds";
109 char const*
const p = demangled_name.get();
117inline std::string demangle(
const std::type_info& info)
119 return demangle(std::type_index(info));
Definition: demangle_util.h:29
Definition: action_node.h:24