00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _EXT_TYPE_TRAITS
00036 #define _EXT_TYPE_TRAITS 1
00037
00038 #pragma GCC system_header
00039
00040 #include <cstddef>
00041 #include <utility>
00042 #include <bits/cpp_type_traits.h>
00043
00044 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
00045
00046
00047 template<bool, typename>
00048 struct __enable_if
00049 { };
00050
00051 template<typename _Tp>
00052 struct __enable_if<true, _Tp>
00053 { typedef _Tp __type; };
00054
00055
00056
00057 template<bool _Cond, typename _Iftrue, typename _Iffalse>
00058 struct __conditional_type
00059 { typedef _Iftrue __type; };
00060
00061 template<typename _Iftrue, typename _Iffalse>
00062 struct __conditional_type<false, _Iftrue, _Iffalse>
00063 { typedef _Iffalse __type; };
00064
00065
00066
00067 template<typename _Tp>
00068 struct __add_unsigned
00069 {
00070 private:
00071 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
00072
00073 public:
00074 typedef typename __if_type::__type __type;
00075 };
00076
00077 template<>
00078 struct __add_unsigned<char>
00079 { typedef unsigned char __type; };
00080
00081 template<>
00082 struct __add_unsigned<signed char>
00083 { typedef unsigned char __type; };
00084
00085 template<>
00086 struct __add_unsigned<short>
00087 { typedef unsigned short __type; };
00088
00089 template<>
00090 struct __add_unsigned<int>
00091 { typedef unsigned int __type; };
00092
00093 template<>
00094 struct __add_unsigned<long>
00095 { typedef unsigned long __type; };
00096
00097 template<>
00098 struct __add_unsigned<long long>
00099 { typedef unsigned long long __type; };
00100
00101
00102 template<>
00103 struct __add_unsigned<bool>;
00104
00105 template<>
00106 struct __add_unsigned<wchar_t>;
00107
00108
00109
00110 template<typename _Tp>
00111 struct __remove_unsigned
00112 {
00113 private:
00114 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
00115
00116 public:
00117 typedef typename __if_type::__type __type;
00118 };
00119
00120 template<>
00121 struct __remove_unsigned<char>
00122 { typedef signed char __type; };
00123
00124 template<>
00125 struct __remove_unsigned<unsigned char>
00126 { typedef signed char __type; };
00127
00128 template<>
00129 struct __remove_unsigned<unsigned short>
00130 { typedef short __type; };
00131
00132 template<>
00133 struct __remove_unsigned<unsigned int>
00134 { typedef int __type; };
00135
00136 template<>
00137 struct __remove_unsigned<unsigned long>
00138 { typedef long __type; };
00139
00140 template<>
00141 struct __remove_unsigned<unsigned long long>
00142 { typedef long long __type; };
00143
00144
00145 template<>
00146 struct __remove_unsigned<bool>;
00147
00148 template<>
00149 struct __remove_unsigned<wchar_t>;
00150
00151 _GLIBCXX_END_NAMESPACE
00152
00153 #endif