gramods
Loading...
Searching...
No Matches
io_typeid.hh
1
2#ifndef GRAMODS_CORE_TYPEID
3#define GRAMODS_CORE_TYPEID
4
5#include <gmCore/config.hh>
6
7#ifdef __GNUG__
8#include <cxxabi.h>
9#endif
10
11#include <iostream>
12
13BEGIN_NAMESPACE_GRAMODS;
14
19std::ostream &operator<<(std::ostream &out, const std::type_info &id) {
20 std::string type_name = id.name();
21
22#ifdef __GNUG__
23 int status;
24 char *dname = abi::__cxa_demangle(type_name.c_str(), NULL, NULL, &status);
25 if (!status) type_name = dname;
26 std::free(dname);
27#endif
28
29 return out << type_name;
30}
31
32END_NAMESPACE_GRAMODS;
33
34#endif