Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
demangle.hh
Go to the documentation of this file.
1#pragma once
3
4#include <cstdlib>
5#include <cxxabi.h>
6#include <string>
7
8namespace nix {
9
14inline std::string demangle(const char * name)
15{
16 int status;
17 char * demangled = abi::__cxa_demangle(name, nullptr, nullptr, &status);
18 if (demangled) {
19 std::string result(demangled);
20 std::free(demangled);
21 return result;
22 }
23 return name;
24}
25
26} // namespace nix
std::string demangle(const char *name)
Definition demangle.hh:14