Tatooine
demangling.h
Go to the documentation of this file.
1#ifndef TATOOINE_DEMANGLING_H
2#define TATOOINE_DEMANGLING_H
3//==============================================================================
4#include <boost/core/demangle.hpp>
5#include <typeinfo>
6//==============================================================================
7namespace tatooine {
8//==============================================================================
9inline auto type_name(std::type_info const& t) -> std::string {
10 return boost::core::demangle(t.name());
11}
12//------------------------------------------------------------------------------
14template <typename T>
15inline auto type_name(T && /*t*/) -> std::string {
16 return boost::core::demangle(typeid(T).name());
17}
18//------------------------------------------------------------------------------
20template <typename T>
21inline auto type_name() -> std::string {
22 return boost::core::demangle(typeid(T).name());
23}
24//------------------------------------------------------------------------------
26template <typename T>
27inline auto type_name(std::string const& name) -> std::string {
28 return boost::core::demangle(name.c_str());
29}
30//==============================================================================
31} // namespace tatooine
32//==============================================================================
33#endif
Definition: algorithm.h:6
auto type_name() -> std::string
returns demangled typename
Definition: demangling.h:21