Go to the documentation of this file. 1 #ifndef DEMANGLE_UTIL_H
2 #define DEMANGLE_UTIL_H
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)
41 char const*
get() const noexcept
50 #if defined(HAS_CXXABI_H)
56 return abi::__cxa_demangle(name, NULL, &
size, &status);
61 std::free(
const_cast<char*
>(name));
81 inline std::string
demangle(
const std::type_index& index)
83 if(index ==
typeid(std::string))
89 return "std::string_view";
91 if(index ==
typeid(std::chrono::seconds))
93 return "std::chrono::seconds";
95 if(index ==
typeid(std::chrono::milliseconds))
97 return "std::chrono::milliseconds";
99 if(index ==
typeid(std::chrono::microseconds))
101 return "std::chrono::microseconds";
105 char const*
const p = demangled_name.
get();
116 inline std::string
demangle(
const std::type_info& info)
118 return demangle(std::type_index(info));
125 #endif // DEMANGLE_UTIL_H
constexpr auto size(const C &c) -> decltype(c.size())
std::string demangle(char const *name)
char const * get() const noexcept
scoped_demangled_name & operator=(scoped_demangled_name const &)=delete
char const * demangle_alloc(char const *name) noexcept
scoped_demangled_name(char const *name) noexcept
void demangle_free(char const *name) noexcept
~scoped_demangled_name() noexcept
constexpr auto p
Parses the production.
basic_string_view< char > string_view