alpaqa pantr
Nonconvex constrained optimization
Loading...
Searching...
No Matches
demangled-typename.cpp
Go to the documentation of this file.
2#include <memory>
3#ifdef __GNUC__
4#include <cxxabi.h>
5#endif
6
7std::string demangled_typename(const std::type_info &t) {
8#ifdef __GNUC__
9 return std::unique_ptr<char, decltype(&std::free)>{
10 abi::__cxa_demangle(t.name(), nullptr, nullptr, nullptr), std::free}
11 .get();
12#else
13 return t.name();
14#endif
15}
std::string demangled_typename(const std::type_info &t)
Get the pretty name of the given type as a string.