38#if defined(TIMEMORY_UNIX)
47demangle(
const char* _mangled_name,
int* _status =
nullptr)
49#if defined(TIMEMORY_ENABLE_DEMANGLE)
72 char* _demang = abi::__cxa_demangle(_mangled_name,
nullptr,
nullptr, _status);
88 ::memset(_msg,
'\0', 1024 *
sizeof(
char));
89 ::snprintf(_msg, 1024,
"memory allocation failure occurred demangling %s",
98 ::memset(_msg,
'\0', 1024 *
sizeof(
char));
99 ::snprintf(_msg, 1024,
"Invalid argument in: (\"%s\", nullptr, nullptr, %p)",
100 _mangled_name, (
void*) _status);
109 return _demangled_name;
112 return _mangled_name;
121 return demangle(_str.c_str(), _status);
126template <
typename Tp>
131 static auto _val = []() {
135 auto _idx = _tmp.find(_key);
136 _idx = _tmp.find(
'<', _idx);
137 _tmp = _tmp.substr(_idx + 1);
138 _idx = _tmp.find_last_of(
'>');
139 _tmp = _tmp.substr(0, _idx);
141 while((_idx = _tmp.find_last_of(
' ')) == _tmp.length() - 1)
142 _tmp = _tmp.substr(0, _idx);
150template <
typename Tp>
155 static auto _val =
demangle(
typeid(Tp).name());
163#if defined(TIMEMORY_UTILITY_HEADER_MODE)
const hash_alias_ptr_t hash_value_t std::string *& _ret
std::string demangle(const char *_mangled_name, int *_status=nullptr)
tim::mpl::apply< std::string > string
lightweight tuple-alternative for meta-programming logic