@@ -15,9 +15,7 @@ namespace __llvm_libc {
15
15
namespace cpp {
16
16
17
17
template <bool B, typename T> struct enable_if ;
18
- template <typename T> struct enable_if <true , T> {
19
- using type = T;
20
- };
18
+ template <typename T> struct enable_if <true , T> { using type = T; };
21
19
template <bool B, typename T = void >
22
20
using enable_if_t = typename enable_if<B, T>::type;
23
21
@@ -28,15 +26,17 @@ template <typename T, T v> struct integral_constant {
28
26
using true_type = cpp::integral_constant<bool , true >;
29
27
using false_type = cpp::integral_constant<bool , false >;
30
28
31
- template <typename T> struct type_identity {
32
- using type = T;
33
- };
29
+ template <typename T> struct type_identity { using type = T; };
34
30
35
31
template <typename T, typename U> struct is_same : cpp::false_type {};
36
32
template <typename T> struct is_same <T, T> : cpp::true_type {};
37
33
template <typename T, typename U>
38
34
inline constexpr bool is_same_v = is_same<T, U>::value;
39
35
36
+ template <class T > struct is_const : cpp::false_type {};
37
+ template <class T > struct is_const <const T> : cpp::true_type {};
38
+ template <class T > inline constexpr bool is_const_v = is_const<T>::value;
39
+
40
40
template <typename T> struct remove_cv : public type_identity <T> {};
41
41
template <typename T> struct remove_cv <const T> : public type_identity<T> {};
42
42
template <typename T> struct remove_cv <volatile T> : public type_identity<T> {};
@@ -114,46 +114,26 @@ template <typename T> struct is_signed {
114
114
template <typename T> inline constexpr bool is_signed_v = is_signed<T>::value;
115
115
116
116
template <typename T> struct make_unsigned ;
117
- template <> struct make_unsigned <char > {
118
- using type = unsigned char ;
119
- };
120
- template <> struct make_unsigned <signed char > {
121
- using type = unsigned char ;
122
- };
123
- template <> struct make_unsigned <short > {
124
- using type = unsigned short ;
125
- };
126
- template <> struct make_unsigned <int > {
127
- using type = unsigned int ;
128
- };
129
- template <> struct make_unsigned <long > {
130
- using type = unsigned long ;
131
- };
117
+ template <> struct make_unsigned <char > { using type = unsigned char ; };
118
+ template <> struct make_unsigned <signed char > { using type = unsigned char ; };
119
+ template <> struct make_unsigned <short > { using type = unsigned short ; };
120
+ template <> struct make_unsigned <int > { using type = unsigned int ; };
121
+ template <> struct make_unsigned <long > { using type = unsigned long ; };
132
122
template <> struct make_unsigned <long long > {
133
123
using type = unsigned long long ;
134
124
};
135
- template <> struct make_unsigned <unsigned char > {
136
- using type = unsigned char ;
137
- };
125
+ template <> struct make_unsigned <unsigned char > { using type = unsigned char ; };
138
126
template <> struct make_unsigned <unsigned short > {
139
127
using type = unsigned short ;
140
128
};
141
- template <> struct make_unsigned <unsigned int > {
142
- using type = unsigned int ;
143
- };
144
- template <> struct make_unsigned <unsigned long > {
145
- using type = unsigned long ;
146
- };
129
+ template <> struct make_unsigned <unsigned int > { using type = unsigned int ; };
130
+ template <> struct make_unsigned <unsigned long > { using type = unsigned long ; };
147
131
template <> struct make_unsigned <unsigned long long > {
148
132
using type = unsigned long long ;
149
133
};
150
134
#ifdef __SIZEOF_INT128__
151
- template <> struct make_unsigned <__int128_t > {
152
- using type = __uint128_t ;
153
- };
154
- template <> struct make_unsigned <__uint128_t > {
155
- using type = __uint128_t ;
156
- };
135
+ template <> struct make_unsigned <__int128_t > { using type = __uint128_t ; };
136
+ template <> struct make_unsigned <__uint128_t > { using type = __uint128_t ; };
157
137
#endif
158
138
template <typename T> using make_unsigned_t = typename make_unsigned<T>::type;
159
139
0 commit comments