00001
00002 #ifndef INSTIGATE_GENERIC_TYPE_TRAITS
00003 #define INSTIGATE_GENERIC_TYPE_TRAITS
00004
00027
00028
00029
00030
00031
00032
00033
00034 namespace instigate {
00035 namespace generic {
00036 template <typename T> class type_traits;
00037 template <typename T> class type_traits<const T>;
00038 template <typename T> class type_traits<T*>;
00039 template <typename T> class type_traits<const T*>;
00040 template <typename T> class type_traits<T&>;
00041 template <typename T> class type_traits<const T&>;
00042 }
00043 }
00044
00051 template <typename T>
00052 struct instigate::generic::type_traits
00053 {
00055 typedef T& reference_type;
00056 typedef const T& const_reference_type;
00057 typedef T value_type;
00058 typedef const T const_value_type;
00059 typedef T* pointer_type;
00060 typedef const T* const_pointer_type;
00061 };
00062
00063
00065 template <typename T>
00066 struct instigate::generic::type_traits<const T>
00067 {
00069 typedef T& reference_type;
00070 typedef const T& const_reference_type;
00071 typedef T value_type;
00072 typedef const T const_value_type;
00073 typedef T* pointer_type;
00074 typedef const T* const_pointer_type;
00075 };
00076
00078 template <typename T>
00079 struct instigate::generic::type_traits<T*>
00080 {
00082 typedef T& reference_type;
00083 typedef const T& const_reference_type;
00084 typedef T value_type;
00085 typedef const T const_value_type;
00086 typedef T* pointer_type;
00087 typedef const T* const_pointer_type;
00088 };
00089
00091 template <typename T>
00092 struct instigate::generic::type_traits<const T*>
00093 {
00095 typedef T& reference_type;
00096 typedef const T& const_reference_type;
00097 typedef T value_type;
00098 typedef const T const_value_type;
00099 typedef T* pointer_type;
00100 typedef const T* const_pointer_type;
00101 };
00102
00104 template <typename T>
00105 struct instigate::generic::type_traits<T&>
00106 {
00108 typedef T& reference_type;
00109 typedef const T& const_reference_type;
00110 typedef T value_type;
00111 typedef const T const_value_type;
00112 typedef T* pointer_type;
00113 typedef const T* const_pointer_type;
00114 };
00115
00117 template <typename T>
00118 struct instigate::generic::type_traits<const T&>
00119 {
00121 typedef T& reference_type;
00122 typedef const T& const_reference_type;
00123 typedef T value_type;
00124 typedef const T const_value_type;
00125 typedef T* pointer_type;
00126 typedef const T* const_pointer_type;
00127 };
00128
00129 #endif // INSTIGATE_GENERIC_TYPE_TRAITS