1212#include < __config>
1313#include < __type_traits/conditional.h>
1414#include < __type_traits/copy_cv.h>
15- #include < __type_traits/is_enum.h>
16- #include < __type_traits/is_integral.h>
1715#include < __type_traits/is_unsigned.h>
18- #include < __type_traits/nat.h>
1916#include < __type_traits/remove_cv.h>
20- #include < __type_traits/type_list.h>
2117
2218#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2319# pragma GCC system_header
@@ -31,43 +27,23 @@ template <class _Tp>
3127using __make_unsigned_t = __make_unsigned(_Tp);
3228
3329#else
34- // clang-format off
35- typedef __type_list<unsigned char ,
36- __type_list<unsigned short ,
37- __type_list<unsigned int ,
38- __type_list<unsigned long ,
39- __type_list<unsigned long long ,
40- # if _LIBCPP_HAS_INT128
41- __type_list<__uint128_t ,
42- # endif
43- __nat
44- # if _LIBCPP_HAS_INT128
45- >
46- # endif
47- > > > > > __unsigned_types;
48- // clang-format on
49-
50- template <class _Tp , bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
51- struct __make_unsigned {};
5230
5331template <class _Tp >
54- struct __make_unsigned <_Tp, true > {
55- typedef typename __find_first<__unsigned_types, sizeof (_Tp)>::type type;
56- };
32+ struct __make_unsigned {};
5733
5834// clang-format off
59- template <> struct __make_unsigned <bool , true > {};
60- template <> struct __make_unsigned < signed short , true > {typedef unsigned short type;};
61- template <> struct __make_unsigned <unsigned short , true > {typedef unsigned short type;};
62- template <> struct __make_unsigned < signed int , true > {typedef unsigned int type;};
63- template <> struct __make_unsigned <unsigned int , true > {typedef unsigned int type;};
64- template <> struct __make_unsigned < signed long , true > {typedef unsigned long type;};
65- template <> struct __make_unsigned <unsigned long , true > {typedef unsigned long type;};
66- template <> struct __make_unsigned < signed long long , true > {typedef unsigned long long type;};
67- template <> struct __make_unsigned <unsigned long long , true > {typedef unsigned long long type;};
35+ template <> struct __make_unsigned <bool > {};
36+ template <> struct __make_unsigned < signed short > {typedef unsigned short type;};
37+ template <> struct __make_unsigned <unsigned short > {typedef unsigned short type;};
38+ template <> struct __make_unsigned < signed int > {typedef unsigned int type;};
39+ template <> struct __make_unsigned <unsigned int > {typedef unsigned int type;};
40+ template <> struct __make_unsigned < signed long > {typedef unsigned long type;};
41+ template <> struct __make_unsigned <unsigned long > {typedef unsigned long type;};
42+ template <> struct __make_unsigned < signed long long > {typedef unsigned long long type;};
43+ template <> struct __make_unsigned <unsigned long long > {typedef unsigned long long type;};
6844# if _LIBCPP_HAS_INT128
69- template <> struct __make_unsigned <__int128_t , true > {typedef __uint128_t type;};
70- template <> struct __make_unsigned <__uint128_t , true > {typedef __uint128_t type;};
45+ template <> struct __make_unsigned <__int128_t > {typedef __uint128_t type;};
46+ template <> struct __make_unsigned <__uint128_t > {typedef __uint128_t type;};
7147# endif
7248// clang-format on
7349
0 commit comments