MNE-CPP  beta 1.0
typename_old.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef TYPENAMEOLD_H
37 #define TYPENAMEOLD_H
38 
39 
40 #define DECLARE_TYPE_NAME(x) template<> const char *typename<x>::name = #x;
41 #define GET_TYPE_NAME(x) (CTypeName<typeof(x)>::name)
43 DECLARE_TYPE_NAME(int);
44 DECLARE_TYPE_NAME(short);
45 DECLARE_TYPE_NAME(char);
46 DECLARE_TYPE_NAME(double);
47 
48 //=============================================================================================================
54 template <typename T> class CTypeName {
55 public:
56  static const char *name;
57 };
58 
59 
60 #endif // TYPENAMEOLD_H
The CTypeName template class provides a static const to get the type of the template by name...
Definition: typename_old.h:54
#define DECLARE_TYPE_NAME(x)
Definition: typename_old.h:40
static const char * name
Definition: typename_old.h:56