Autowiring  1.0.3
A C++ Inversion of Control Framework
demangle.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved.
2 #pragma once
3 #include <string>
4 #include <typeinfo>
5 #include <typeindex>
6 
7 struct AnySharedPointer;
8 struct auto_id;
9 
10 //
11 // Demangle type names on mac and linux.
12 // Just returns type_info.name() on windows
13 //
14 namespace autowiring {
15  std::string demangle(const std::type_info& ti);
16  std::string demangle(const std::type_info* ti);
17 
18  std::string demangle(const std::type_index& ti);
19  std::string demangle(const std::type_index* ti);
20 
21  std::string demangle(const AnySharedPointer& ptr);
22  std::string demangle(auto_id id);
23 
25  template<typename T>
26  std::string demangle(const T&) {
27  return demangle(typeid(T));
28  }
29 
30 }//namespace autowiring
Definition: auto_arg.h:8