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