00001 #ifndef NMWR_GB_TYPE_NAME_TRAITS_H 00002 #define NMWR_GB_TYPE_NAME_TRAITS_H 00003 00004 00005 // $LICENSE 00006 00007 00008 #include "Forward/string_fwd.h" 00009 00010 //---------------------------------------------------------------- 00011 //-------------------------------------------------------------- 00023 00025 00026 template<class T> 00027 struct type_name_traits { 00028 static const char* name() { return "";} 00029 }; 00030 00032 struct type_name_traits<bool> { 00033 static const char* name() { return "bool";} 00034 }; 00035 00036 00037 struct type_name_traits<int> { 00038 static const char* name() { return "int";} 00039 }; 00040 00041 struct type_name_traits<unsigned> { 00042 static const char* name() { return "unsigned";} 00043 }; 00044 00045 struct type_name_traits<short> { 00046 static const char* name() { return "short";} 00047 }; 00048 00049 struct type_name_traits<long> { 00050 static const char* name() { return "long";} 00051 }; 00052 00053 struct type_name_traits<char> { 00054 static const char* name() { return "char";} 00055 }; 00056 00057 00058 struct type_name_traits<float> { 00059 static const char* name() { return "float";} 00060 }; 00061 00062 struct type_name_traits<double> { 00063 static const char* name() { return "double";} 00064 }; 00065 00066 struct type_name_traits<std::string> { 00067 static const char* name() { return "string";} 00068 }; 00069 00071 #endif