Skip to content

Commit 3c56437

Browse files
authoredJun 11, 2025··
[libc++] Refactor signed/unsigned integer traits (#142750)
This patch does a few things: - `__libcpp_is_signed_integer` and `__libcpp_is_unsigned_integer` are refactored to be variable templates instead of class templates. - the two traits are merged into a single header `<__type_traits/integer_traits.h>`. - `__libcpp_signed_integer`, `__libcpp_unsigned_integer` and `__libcpp_integer` are moved into the same header. - The above mentioned concepts are renamed to `__signed_integer`, `__unsigned_integer` and `__signed_or_unsigned_integer` respectively.
1 parent b49c789 commit 3c56437

22 files changed

+223
-245
lines changed
 

‎libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ set(files
800800
__type_traits/extent.h
801801
__type_traits/has_unique_object_representation.h
802802
__type_traits/has_virtual_destructor.h
803+
__type_traits/integer_traits.h
803804
__type_traits/integral_constant.h
804805
__type_traits/invoke.h
805806
__type_traits/is_abstract.h
@@ -850,7 +851,6 @@ set(files
850851
__type_traits/is_same.h
851852
__type_traits/is_scalar.h
852853
__type_traits/is_signed.h
853-
__type_traits/is_signed_integer.h
854854
__type_traits/is_specialization.h
855855
__type_traits/is_standard_layout.h
856856
__type_traits/is_swappable.h
@@ -864,7 +864,6 @@ set(files
864864
__type_traits/is_unbounded_array.h
865865
__type_traits/is_union.h
866866
__type_traits/is_unsigned.h
867-
__type_traits/is_unsigned_integer.h
868867
__type_traits/is_valid_expansion.h
869868
__type_traits/is_void.h
870869
__type_traits/is_volatile.h

‎libcxx/include/__bit/bit_ceil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#include <__assert>
1313
#include <__bit/countl.h>
14-
#include <__concepts/arithmetic.h>
1514
#include <__config>
15+
#include <__type_traits/integer_traits.h>
1616
#include <limits>
1717

1818
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -41,7 +41,7 @@ template <class _Tp>
4141

4242
# if _LIBCPP_STD_VER >= 20
4343

44-
template <__libcpp_unsigned_integer _Tp>
44+
template <__unsigned_integer _Tp>
4545
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept {
4646
return std::__bit_ceil(__t);
4747
}

‎libcxx/include/__bit/bit_floor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#define _LIBCPP___BIT_BIT_FLOOR_H
1111

1212
#include <__bit/bit_log2.h>
13-
#include <__concepts/arithmetic.h>
1413
#include <__config>
14+
#include <__type_traits/integer_traits.h>
1515

1616
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1717
# pragma GCC system_header
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 20
2323

24-
template <__libcpp_unsigned_integer _Tp>
24+
template <__unsigned_integer _Tp>
2525
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept {
2626
return __t == 0 ? 0 : _Tp{1} << std::__bit_log2(__t);
2727
}

‎libcxx/include/__bit/bit_log2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <__bit/countl.h>
1313
#include <__config>
14-
#include <__type_traits/is_unsigned_integer.h>
14+
#include <__type_traits/integer_traits.h>
1515
#include <limits>
1616

1717
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2222

2323
template <class _Tp>
2424
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __bit_log2(_Tp __t) _NOEXCEPT {
25-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__bit_log2 requires an unsigned integer type");
25+
static_assert(__is_unsigned_integer_v<_Tp>, "__bit_log2 requires an unsigned integer type");
2626
return numeric_limits<_Tp>::digits - 1 - std::__countl_zero(__t);
2727
}
2828

‎libcxx/include/__bit/bit_width.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#define _LIBCPP___BIT_BIT_WIDTH_H
1111

1212
#include <__bit/bit_log2.h>
13-
#include <__concepts/arithmetic.h>
1413
#include <__config>
14+
#include <__type_traits/integer_traits.h>
1515

1616
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1717
# pragma GCC system_header
@@ -21,7 +21,7 @@
2121

2222
_LIBCPP_BEGIN_NAMESPACE_STD
2323

24-
template <__libcpp_unsigned_integer _Tp>
24+
template <__unsigned_integer _Tp>
2525
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept {
2626
return __t == 0 ? 0 : std::__bit_log2(__t) + 1;
2727
}

‎libcxx/include/__bit/countl.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef _LIBCPP___BIT_COUNTL_H
1010
#define _LIBCPP___BIT_COUNTL_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
14-
#include <__type_traits/is_unsigned_integer.h>
13+
#include <__type_traits/integer_traits.h>
1514
#include <limits>
1615

1716
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -25,18 +24,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2524

2625
template <class _Tp>
2726
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _NOEXCEPT {
28-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countl_zero requires an unsigned integer type");
27+
static_assert(__is_unsigned_integer_v<_Tp>, "__countl_zero requires an unsigned integer type");
2928
return __builtin_clzg(__t, numeric_limits<_Tp>::digits);
3029
}
3130

3231
#if _LIBCPP_STD_VER >= 20
3332

34-
template <__libcpp_unsigned_integer _Tp>
33+
template <__unsigned_integer _Tp>
3534
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept {
3635
return std::__countl_zero(__t);
3736
}
3837

39-
template <__libcpp_unsigned_integer _Tp>
38+
template <__unsigned_integer _Tp>
4039
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept {
4140
return __t != numeric_limits<_Tp>::max() ? std::countl_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
4241
}

‎libcxx/include/__bit/countr.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef _LIBCPP___BIT_COUNTR_H
1010
#define _LIBCPP___BIT_COUNTR_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
14-
#include <__type_traits/is_unsigned_integer.h>
13+
#include <__type_traits/integer_traits.h>
1514
#include <limits>
1615

1716
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -25,18 +24,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2524

2625
template <class _Tp>
2726
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __countr_zero(_Tp __t) _NOEXCEPT {
28-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__countr_zero only works with unsigned types");
27+
static_assert(__is_unsigned_integer_v<_Tp>, "__countr_zero only works with unsigned types");
2928
return __builtin_ctzg(__t, numeric_limits<_Tp>::digits);
3029
}
3130

3231
#if _LIBCPP_STD_VER >= 20
3332

34-
template <__libcpp_unsigned_integer _Tp>
33+
template <__unsigned_integer _Tp>
3534
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept {
3635
return std::__countr_zero(__t);
3736
}
3837

39-
template <__libcpp_unsigned_integer _Tp>
38+
template <__unsigned_integer _Tp>
4039
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept {
4140
return __t != numeric_limits<_Tp>::max() ? std::countr_zero(static_cast<_Tp>(~__t)) : numeric_limits<_Tp>::digits;
4241
}

‎libcxx/include/__bit/has_single_bit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef _LIBCPP___BIT_HAS_SINGLE_BIT_H
1010
#define _LIBCPP___BIT_HAS_SINGLE_BIT_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
13+
#include <__type_traits/integer_traits.h>
1414

1515
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1616
# pragma GCC system_header
@@ -23,7 +23,7 @@ _LIBCPP_PUSH_MACROS
2323

2424
_LIBCPP_BEGIN_NAMESPACE_STD
2525

26-
template <__libcpp_unsigned_integer _Tp>
26+
template <__unsigned_integer _Tp>
2727
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept {
2828
return __t != 0 && (((__t & (__t - 1)) == 0));
2929
}

‎libcxx/include/__bit/popcount.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef _LIBCPP___BIT_POPCOUNT_H
1010
#define _LIBCPP___BIT_POPCOUNT_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
14-
#include <__type_traits/is_unsigned_integer.h>
13+
#include <__type_traits/integer_traits.h>
1514

1615
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1716
# pragma GCC system_header
@@ -24,13 +23,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2423

2524
template <class _Tp>
2625
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount(_Tp __t) _NOEXCEPT {
27-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__popcount only works with unsigned types");
26+
static_assert(__is_unsigned_integer_v<_Tp>, "__popcount only works with unsigned types");
2827
return __builtin_popcountg(__t);
2928
}
3029

3130
#if _LIBCPP_STD_VER >= 20
3231

33-
template <__libcpp_unsigned_integer _Tp>
32+
template <__unsigned_integer _Tp>
3433
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept {
3534
return std::__popcount(__t);
3635
}

‎libcxx/include/__bit/rotate.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#ifndef _LIBCPP___BIT_ROTATE_H
1010
#define _LIBCPP___BIT_ROTATE_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
14-
#include <__type_traits/is_unsigned_integer.h>
13+
#include <__type_traits/integer_traits.h>
1514
#include <limits>
1615

1716
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -25,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2524
// the rotr function becomes the ROR instruction.
2625
template <class _Tp>
2726
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotl(_Tp __x, int __s) _NOEXCEPT {
28-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__rotl requires an unsigned integer type");
27+
static_assert(__is_unsigned_integer_v<_Tp>, "__rotl requires an unsigned integer type");
2928
const int __n = numeric_limits<_Tp>::digits;
3029
int __r = __s % __n;
3130

@@ -40,7 +39,7 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotl(_Tp __x, int __s)
4039

4140
template <class _Tp>
4241
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotr(_Tp __x, int __s) _NOEXCEPT {
43-
static_assert(__libcpp_is_unsigned_integer<_Tp>::value, "__rotr requires an unsigned integer type");
42+
static_assert(__is_unsigned_integer_v<_Tp>, "__rotr requires an unsigned integer type");
4443
const int __n = numeric_limits<_Tp>::digits;
4544
int __r = __s % __n;
4645

@@ -55,12 +54,12 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __rotr(_Tp __x, int __s)
5554

5655
#if _LIBCPP_STD_VER >= 20
5756

58-
template <__libcpp_unsigned_integer _Tp>
57+
template <__unsigned_integer _Tp>
5958
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, int __cnt) noexcept {
6059
return std::__rotl(__t, __cnt);
6160
}
6261

63-
template <__libcpp_unsigned_integer _Tp>
62+
template <__unsigned_integer _Tp>
6463
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept {
6564
return std::__rotr(__t, __cnt);
6665
}

‎libcxx/include/__concepts/arithmetic.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include <__type_traits/is_floating_point.h>
1414
#include <__type_traits/is_integral.h>
1515
#include <__type_traits/is_signed.h>
16-
#include <__type_traits/is_signed_integer.h>
17-
#include <__type_traits/is_unsigned_integer.h>
1816

1917
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2018
# pragma GCC system_header
@@ -38,17 +36,6 @@ concept unsigned_integral = integral<_Tp> && !signed_integral<_Tp>;
3836
template <class _Tp>
3937
concept floating_point = is_floating_point_v<_Tp>;
4038

41-
// Concept helpers for the internal type traits for the fundamental types.
42-
43-
template <class _Tp>
44-
concept __libcpp_unsigned_integer = __libcpp_is_unsigned_integer<_Tp>::value;
45-
46-
template <class _Tp>
47-
concept __libcpp_signed_integer = __libcpp_is_signed_integer<_Tp>::value;
48-
49-
template <class _Tp>
50-
concept __libcpp_integer = __libcpp_unsigned_integer<_Tp> || __libcpp_signed_integer<_Tp>;
51-
5239
#endif // _LIBCPP_STD_VER >= 20
5340

5441
_LIBCPP_END_NAMESPACE_STD

‎libcxx/include/__format/format_arg_store.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# pragma GCC system_header
1515
#endif
1616

17-
#include <__concepts/arithmetic.h>
1817
#include <__concepts/same_as.h>
1918
#include <__config>
2019
#include <__cstddef/size_t.h>
2120
#include <__format/concepts.h>
2221
#include <__format/format_arg.h>
2322
#include <__type_traits/conditional.h>
2423
#include <__type_traits/extent.h>
24+
#include <__type_traits/integer_traits.h>
2525
#include <__type_traits/remove_const.h>
2626
#include <cstdint>
2727
#include <string>
@@ -65,7 +65,7 @@ consteval __arg_t __determine_arg_t() {
6565
# endif
6666

6767
// Signed integers
68-
template <class, __libcpp_signed_integer _Tp>
68+
template <class, __signed_integer _Tp>
6969
consteval __arg_t __determine_arg_t() {
7070
if constexpr (sizeof(_Tp) <= sizeof(int))
7171
return __arg_t::__int;
@@ -80,7 +80,7 @@ consteval __arg_t __determine_arg_t() {
8080
}
8181

8282
// Unsigned integers
83-
template <class, __libcpp_unsigned_integer _Tp>
83+
template <class, __unsigned_integer _Tp>
8484
consteval __arg_t __determine_arg_t() {
8585
if constexpr (sizeof(_Tp) <= sizeof(unsigned))
8686
return __arg_t::__unsigned;

‎libcxx/include/__mdspan/extents.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
#include <__config>
2222

2323
#include <__concepts/arithmetic.h>
24-
#include <__cstddef/byte.h>
2524
#include <__type_traits/common_type.h>
25+
#include <__type_traits/integer_traits.h>
2626
#include <__type_traits/is_convertible.h>
2727
#include <__type_traits/is_nothrow_constructible.h>
28-
#include <__type_traits/is_same.h>
2928
#include <__type_traits/make_unsigned.h>
3029
#include <__utility/integer_sequence.h>
3130
#include <__utility/unreachable.h>
@@ -283,7 +282,8 @@ class extents {
283282
using size_type = make_unsigned_t<index_type>;
284283
using rank_type = size_t;
285284

286-
static_assert(__libcpp_integer<index_type>, "extents::index_type must be a signed or unsigned integer type");
285+
static_assert(__signed_or_unsigned_integer<index_type>,
286+
"extents::index_type must be a signed or unsigned integer type");
287287
static_assert(((__mdspan_detail::__is_representable_as<index_type>(_Extents) || (_Extents == dynamic_extent)) && ...),
288288
"extents ctor: arguments must be representable as index_type and nonnegative");
289289

‎libcxx/include/__numeric/saturation_arithmetic.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#define _LIBCPP___NUMERIC_SATURATION_ARITHMETIC_H
1212

1313
#include <__assert>
14-
#include <__concepts/arithmetic.h>
1514
#include <__config>
1615
#include <__memory/addressof.h>
16+
#include <__type_traits/integer_traits.h>
1717
#include <__utility/cmp.h>
1818
#include <limits>
1919

@@ -28,12 +28,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2828

2929
#if _LIBCPP_STD_VER >= 20
3030

31-
template <__libcpp_integer _Tp>
31+
template <__signed_or_unsigned_integer _Tp>
3232
_LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {
3333
if (_Tp __sum; !__builtin_add_overflow(__x, __y, std::addressof(__sum)))
3434
return __sum;
3535
// Handle overflow
36-
if constexpr (__libcpp_unsigned_integer<_Tp>) {
36+
if constexpr (__unsigned_integer<_Tp>) {
3737
return std::numeric_limits<_Tp>::max();
3838
} else {
3939
// Signed addition overflow
@@ -46,12 +46,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __add_sat(_Tp __x, _Tp __y) noexcept {
4646
}
4747
}
4848

49-
template <__libcpp_integer _Tp>
49+
template <__signed_or_unsigned_integer _Tp>
5050
_LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {
5151
if (_Tp __sub; !__builtin_sub_overflow(__x, __y, std::addressof(__sub)))
5252
return __sub;
5353
// Handle overflow
54-
if constexpr (__libcpp_unsigned_integer<_Tp>) {
54+
if constexpr (__unsigned_integer<_Tp>) {
5555
// Overflows if (x < y)
5656
return std::numeric_limits<_Tp>::min();
5757
} else {
@@ -65,12 +65,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __sub_sat(_Tp __x, _Tp __y) noexcept {
6565
}
6666
}
6767

68-
template <__libcpp_integer _Tp>
68+
template <__signed_or_unsigned_integer _Tp>
6969
_LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept {
7070
if (_Tp __mul; !__builtin_mul_overflow(__x, __y, std::addressof(__mul)))
7171
return __mul;
7272
// Handle overflow
73-
if constexpr (__libcpp_unsigned_integer<_Tp>) {
73+
if constexpr (__unsigned_integer<_Tp>) {
7474
return std::numeric_limits<_Tp>::max();
7575
} else {
7676
// Signed multiplication overflow
@@ -81,10 +81,10 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mul_sat(_Tp __x, _Tp __y) noexcept {
8181
}
8282
}
8383

84-
template <__libcpp_integer _Tp>
84+
template <__signed_or_unsigned_integer _Tp>
8585
_LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept {
8686
_LIBCPP_ASSERT_UNCATEGORIZED(__y != 0, "Division by 0 is undefined");
87-
if constexpr (__libcpp_unsigned_integer<_Tp>) {
87+
if constexpr (__unsigned_integer<_Tp>) {
8888
return __x / __y;
8989
} else {
9090
// Handle signed division overflow
@@ -94,7 +94,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Tp __div_sat(_Tp __x, _Tp __y) noexcept {
9494
}
9595
}
9696

97-
template <__libcpp_integer _Rp, __libcpp_integer _Tp>
97+
template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
9898
_LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {
9999
// Saturation is impossible edge case when ((min _Rp) < (min _Tp) && (max _Rp) > (max _Tp)) and it is expected to be
100100
// optimized out by the compiler.
@@ -112,27 +112,27 @@ _LIBCPP_HIDE_FROM_ABI constexpr _Rp __saturate_cast(_Tp __x) noexcept {
112112

113113
#if _LIBCPP_STD_VER >= 26
114114

115-
template <__libcpp_integer _Tp>
115+
template <__signed_or_unsigned_integer _Tp>
116116
_LIBCPP_HIDE_FROM_ABI constexpr _Tp add_sat(_Tp __x, _Tp __y) noexcept {
117117
return std::__add_sat(__x, __y);
118118
}
119119

120-
template <__libcpp_integer _Tp>
120+
template <__signed_or_unsigned_integer _Tp>
121121
_LIBCPP_HIDE_FROM_ABI constexpr _Tp sub_sat(_Tp __x, _Tp __y) noexcept {
122122
return std::__sub_sat(__x, __y);
123123
}
124124

125-
template <__libcpp_integer _Tp>
125+
template <__signed_or_unsigned_integer _Tp>
126126
_LIBCPP_HIDE_FROM_ABI constexpr _Tp mul_sat(_Tp __x, _Tp __y) noexcept {
127127
return std::__mul_sat(__x, __y);
128128
}
129129

130-
template <__libcpp_integer _Tp>
130+
template <__signed_or_unsigned_integer _Tp>
131131
_LIBCPP_HIDE_FROM_ABI constexpr _Tp div_sat(_Tp __x, _Tp __y) noexcept {
132132
return std::__div_sat(__x, __y);
133133
}
134134

135-
template <__libcpp_integer _Rp, __libcpp_integer _Tp>
135+
template <__signed_or_unsigned_integer _Rp, __signed_or_unsigned_integer _Tp>
136136
_LIBCPP_HIDE_FROM_ABI constexpr _Rp saturate_cast(_Tp __x) noexcept {
137137
return std::__saturate_cast<_Rp>(__x);
138138
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H
10+
#define _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H
11+
12+
#include <__config>
13+
14+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15+
# pragma GCC system_header
16+
#endif
17+
18+
_LIBCPP_BEGIN_NAMESPACE_STD
19+
20+
// This trait is to determine whether a type is a /signed integer type/
21+
// See [basic.fundamental]/p1
22+
template <class _Tp>
23+
inline const bool __is_signed_integer_v = false;
24+
template <>
25+
inline const bool __is_signed_integer_v<signed char> = true;
26+
template <>
27+
inline const bool __is_signed_integer_v<signed short> = true;
28+
template <>
29+
inline const bool __is_signed_integer_v<signed int> = true;
30+
template <>
31+
inline const bool __is_signed_integer_v<signed long> = true;
32+
template <>
33+
inline const bool __is_signed_integer_v<signed long long> = true;
34+
#if _LIBCPP_HAS_INT128
35+
template <>
36+
inline const bool __is_signed_integer_v<__int128_t> = true;
37+
#endif
38+
39+
// This trait is to determine whether a type is an /unsigned integer type/
40+
// See [basic.fundamental]/p2
41+
template <class _Tp>
42+
inline const bool __is_unsigned_integer_v = false;
43+
template <>
44+
inline const bool __is_unsigned_integer_v<unsigned char> = true;
45+
template <>
46+
inline const bool __is_unsigned_integer_v<unsigned short> = true;
47+
template <>
48+
inline const bool __is_unsigned_integer_v<unsigned int> = true;
49+
template <>
50+
inline const bool __is_unsigned_integer_v<unsigned long> = true;
51+
template <>
52+
inline const bool __is_unsigned_integer_v<unsigned long long> = true;
53+
#if _LIBCPP_HAS_INT128
54+
template <>
55+
inline const bool __is_unsigned_integer_v<__uint128_t> = true;
56+
#endif
57+
58+
#if _LIBCPP_STD_VER >= 20
59+
template <class _Tp>
60+
concept __signed_integer = __is_signed_integer_v<_Tp>;
61+
62+
template <class _Tp>
63+
concept __unsigned_integer = __is_unsigned_integer_v<_Tp>;
64+
65+
// This isn't called __integer, because an integer type according to [basic.fundamental]/p11 is the same as an integral
66+
// type. An integral type is _not_ the same set of types as signed and unsigned integer types combined.
67+
template <class _Tp>
68+
concept __signed_or_unsigned_integer = __signed_integer<_Tp> || __unsigned_integer<_Tp>;
69+
#endif
70+
71+
_LIBCPP_END_NAMESPACE_STD
72+
73+
#endif // _LIBCPP___TYPE_TRAITS_INTEGER_TRAITS_H

‎libcxx/include/__type_traits/is_signed_integer.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎libcxx/include/__type_traits/is_unsigned_integer.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎libcxx/include/__utility/cmp.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef _LIBCPP___UTILITY_CMP_H
1010
#define _LIBCPP___UTILITY_CMP_H
1111

12-
#include <__concepts/arithmetic.h>
1312
#include <__config>
13+
#include <__type_traits/integer_traits.h>
1414
#include <__type_traits/is_signed.h>
1515
#include <__type_traits/make_unsigned.h>
1616
#include <limits>
@@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2626

2727
#if _LIBCPP_STD_VER >= 20
2828

29-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
29+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
3030
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {
3131
if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
3232
return __t == __u;
@@ -36,12 +36,12 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept {
3636
return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u);
3737
}
3838

39-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
39+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
4040
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept {
4141
return !std::cmp_equal(__t, __u);
4242
}
4343

44-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
44+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
4545
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {
4646
if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
4747
return __t < __u;
@@ -51,22 +51,22 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept {
5151
return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u);
5252
}
5353

54-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
54+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
5555
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept {
5656
return std::cmp_less(__u, __t);
5757
}
5858

59-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
59+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
6060
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept {
6161
return !std::cmp_greater(__t, __u);
6262
}
6363

64-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
64+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
6565
_LIBCPP_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept {
6666
return !std::cmp_less(__t, __u);
6767
}
6868

69-
template <__libcpp_integer _Tp, __libcpp_integer _Up>
69+
template <__signed_or_unsigned_integer _Tp, __signed_or_unsigned_integer _Up>
7070
_LIBCPP_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept {
7171
return std::cmp_less_equal(__u, numeric_limits<_Tp>::max()) &&
7272
std::cmp_greater_equal(__u, numeric_limits<_Tp>::min());

‎libcxx/include/module.modulemap.in

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ module std_core [system] {
9494
module extent { header "__type_traits/extent.h" }
9595
module has_unique_object_representation { header "__type_traits/has_unique_object_representation.h" }
9696
module has_virtual_destructor { header "__type_traits/has_virtual_destructor.h" }
97+
module integer_traits { header "__type_traits/integer_traits.h" }
9798
module integral_constant { header "__type_traits/integral_constant.h" }
9899
module invoke { header "__type_traits/invoke.h" }
99100
module is_abstract {
@@ -284,10 +285,6 @@ module std_core [system] {
284285
header "__type_traits/is_scalar.h"
285286
export std_core.type_traits.integral_constant
286287
}
287-
module is_signed_integer {
288-
header "__type_traits/is_signed_integer.h"
289-
export std_core.type_traits.integral_constant
290-
}
291288
module is_signed {
292289
header "__type_traits/is_signed.h"
293290
export std_core.type_traits.integral_constant
@@ -340,10 +337,6 @@ module std_core [system] {
340337
header "__type_traits/is_union.h"
341338
export std_core.type_traits.integral_constant
342339
}
343-
module is_unsigned_integer {
344-
header "__type_traits/is_unsigned_integer.h"
345-
export std_core.type_traits.integral_constant
346-
}
347340
module is_unsigned {
348341
header "__type_traits/is_unsigned.h"
349342
export std_core.type_traits.integral_constant

‎libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_integer.compile.pass.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Concept helpers for the internal type traits for the fundamental types.
1212

1313
// template <class _Tp>
14-
// concept __libcpp_integer;
14+
// concept __signed_or_unsigned_integer;
1515

16-
#include <concepts>
16+
#include <__type_traits/integer_traits.h>
1717

1818
#include "test_macros.h"
1919

@@ -24,40 +24,40 @@ enum SomeEnum {};
2424
enum class SomeScopedEnum {};
2525

2626
// Unsigned
27-
static_assert(std::__libcpp_integer<unsigned char>);
28-
static_assert(std::__libcpp_integer<unsigned short int>);
29-
static_assert(std::__libcpp_integer<unsigned int>);
30-
static_assert(std::__libcpp_integer<unsigned long int>);
31-
static_assert(std::__libcpp_integer<unsigned long long int>);
32-
static_assert(std::__libcpp_integer<unsigned short int>);
27+
static_assert(std::__signed_or_unsigned_integer<unsigned char>);
28+
static_assert(std::__signed_or_unsigned_integer<unsigned short int>);
29+
static_assert(std::__signed_or_unsigned_integer<unsigned int>);
30+
static_assert(std::__signed_or_unsigned_integer<unsigned long int>);
31+
static_assert(std::__signed_or_unsigned_integer<unsigned long long int>);
32+
static_assert(std::__signed_or_unsigned_integer<unsigned short int>);
3333
#if _LIBCPP_HAS_INT128
34-
static_assert(std::__libcpp_integer<__uint128_t>);
34+
static_assert(std::__signed_or_unsigned_integer<__uint128_t>);
3535
#endif
3636
// Signed
37-
static_assert(std::__libcpp_integer<signed char>);
38-
static_assert(std::__libcpp_integer<short int>);
39-
static_assert(std::__libcpp_integer<int>);
40-
static_assert(std::__libcpp_integer<long int>);
41-
static_assert(std::__libcpp_integer<long long int>);
42-
static_assert(std::__libcpp_integer<short int>);
37+
static_assert(std::__signed_or_unsigned_integer<signed char>);
38+
static_assert(std::__signed_or_unsigned_integer<short int>);
39+
static_assert(std::__signed_or_unsigned_integer<int>);
40+
static_assert(std::__signed_or_unsigned_integer<long int>);
41+
static_assert(std::__signed_or_unsigned_integer<long long int>);
42+
static_assert(std::__signed_or_unsigned_integer<short int>);
4343
#if _LIBCPP_HAS_INT128
44-
static_assert(std::__libcpp_integer<__int128_t>);
44+
static_assert(std::__signed_or_unsigned_integer<__int128_t>);
4545
#endif
4646
// Non-integer
47-
static_assert(!std::__libcpp_integer<bool>);
48-
static_assert(!std::__libcpp_integer<char>);
47+
static_assert(!std::__signed_or_unsigned_integer<bool>);
48+
static_assert(!std::__signed_or_unsigned_integer<char>);
4949
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
50-
static_assert(!std::__libcpp_integer<wchar_t>);
50+
static_assert(!std::__signed_or_unsigned_integer<wchar_t>);
5151
#endif
52-
static_assert(!std::__libcpp_integer<char8_t>);
53-
static_assert(!std::__libcpp_integer<char16_t>);
54-
static_assert(!std::__libcpp_integer<char32_t>);
55-
static_assert(!std::__libcpp_integer<float>);
56-
static_assert(!std::__libcpp_integer<double>);
57-
static_assert(!std::__libcpp_integer<long double>);
58-
static_assert(!std::__libcpp_integer<void>);
59-
static_assert(!std::__libcpp_integer<int*>);
60-
static_assert(!std::__libcpp_integer<unsigned int*>);
61-
static_assert(!std::__libcpp_integer<SomeObject>);
62-
static_assert(!std::__libcpp_integer<SomeEnum>);
63-
static_assert(!std::__libcpp_integer<SomeScopedEnum>);
52+
static_assert(!std::__signed_or_unsigned_integer<char8_t>);
53+
static_assert(!std::__signed_or_unsigned_integer<char16_t>);
54+
static_assert(!std::__signed_or_unsigned_integer<char32_t>);
55+
static_assert(!std::__signed_or_unsigned_integer<float>);
56+
static_assert(!std::__signed_or_unsigned_integer<double>);
57+
static_assert(!std::__signed_or_unsigned_integer<long double>);
58+
static_assert(!std::__signed_or_unsigned_integer<void>);
59+
static_assert(!std::__signed_or_unsigned_integer<int*>);
60+
static_assert(!std::__signed_or_unsigned_integer<unsigned int*>);
61+
static_assert(!std::__signed_or_unsigned_integer<SomeObject>);
62+
static_assert(!std::__signed_or_unsigned_integer<SomeEnum>);
63+
static_assert(!std::__signed_or_unsigned_integer<SomeScopedEnum>);

‎libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_signed_integer.compile.pass.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Concept helpers for the internal type traits for the fundamental types.
1212

1313
// template <class _Tp>
14-
// concept __libcpp_signed_integer;
14+
// concept __signed_integer;
1515

16-
#include <concepts>
16+
#include <__type_traits/integer_traits.h>
1717

1818
#include "test_macros.h"
1919

@@ -24,40 +24,40 @@ enum SomeEnum {};
2424
enum class SomeScopedEnum {};
2525

2626
// Unsigned
27-
static_assert(!std::__libcpp_signed_integer<unsigned char>);
28-
static_assert(!std::__libcpp_signed_integer<unsigned short int>);
29-
static_assert(!std::__libcpp_signed_integer<unsigned int>);
30-
static_assert(!std::__libcpp_signed_integer<unsigned long int>);
31-
static_assert(!std::__libcpp_signed_integer<unsigned long long int>);
32-
static_assert(!std::__libcpp_signed_integer<unsigned short int>);
27+
static_assert(!std::__signed_integer<unsigned char>);
28+
static_assert(!std::__signed_integer<unsigned short int>);
29+
static_assert(!std::__signed_integer<unsigned int>);
30+
static_assert(!std::__signed_integer<unsigned long int>);
31+
static_assert(!std::__signed_integer<unsigned long long int>);
32+
static_assert(!std::__signed_integer<unsigned short int>);
3333
#if _LIBCPP_HAS_INT128
34-
static_assert(!std::__libcpp_signed_integer<__uint128_t>);
34+
static_assert(!std::__signed_integer<__uint128_t>);
3535
#endif
3636
// Signed
37-
static_assert(std::__libcpp_signed_integer<signed char>);
38-
static_assert(std::__libcpp_signed_integer<short int>);
39-
static_assert(std::__libcpp_signed_integer<int>);
40-
static_assert(std::__libcpp_signed_integer<long int>);
41-
static_assert(std::__libcpp_signed_integer<long long int>);
42-
static_assert(std::__libcpp_signed_integer<short int>);
37+
static_assert(std::__signed_integer<signed char>);
38+
static_assert(std::__signed_integer<short int>);
39+
static_assert(std::__signed_integer<int>);
40+
static_assert(std::__signed_integer<long int>);
41+
static_assert(std::__signed_integer<long long int>);
42+
static_assert(std::__signed_integer<short int>);
4343
#if _LIBCPP_HAS_INT128
44-
static_assert(std::__libcpp_signed_integer<__int128_t>);
44+
static_assert(std::__signed_integer<__int128_t>);
4545
#endif
4646
// Non-integer
47-
static_assert(!std::__libcpp_signed_integer<bool>);
48-
static_assert(!std::__libcpp_signed_integer<char>);
47+
static_assert(!std::__signed_integer<bool>);
48+
static_assert(!std::__signed_integer<char>);
4949
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
50-
static_assert(!std::__libcpp_signed_integer<wchar_t>);
50+
static_assert(!std::__signed_integer<wchar_t>);
5151
#endif
52-
static_assert(!std::__libcpp_signed_integer<char8_t>);
53-
static_assert(!std::__libcpp_signed_integer<char16_t>);
54-
static_assert(!std::__libcpp_signed_integer<char32_t>);
55-
static_assert(!std::__libcpp_signed_integer<float>);
56-
static_assert(!std::__libcpp_signed_integer<double>);
57-
static_assert(!std::__libcpp_signed_integer<long double>);
58-
static_assert(!std::__libcpp_signed_integer<void>);
59-
static_assert(!std::__libcpp_signed_integer<int*>);
60-
static_assert(!std::__libcpp_signed_integer<unsigned int*>);
61-
static_assert(!std::__libcpp_signed_integer<SomeObject>);
62-
static_assert(!std::__libcpp_signed_integer<SomeEnum>);
63-
static_assert(!std::__libcpp_signed_integer<SomeScopedEnum>);
52+
static_assert(!std::__signed_integer<char8_t>);
53+
static_assert(!std::__signed_integer<char16_t>);
54+
static_assert(!std::__signed_integer<char32_t>);
55+
static_assert(!std::__signed_integer<float>);
56+
static_assert(!std::__signed_integer<double>);
57+
static_assert(!std::__signed_integer<long double>);
58+
static_assert(!std::__signed_integer<void>);
59+
static_assert(!std::__signed_integer<int*>);
60+
static_assert(!std::__signed_integer<unsigned int*>);
61+
static_assert(!std::__signed_integer<SomeObject>);
62+
static_assert(!std::__signed_integer<SomeEnum>);
63+
static_assert(!std::__signed_integer<SomeScopedEnum>);

‎libcxx/test/libcxx/concepts/concepts.arithmetic/__libcpp_unsigned_integer.compile.pass.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Concept helpers for the internal type traits for the fundamental types.
1212

1313
// template <class _Tp>
14-
// concept __libcpp_unsigned_integer;
14+
// concept __unsigned_integer;
1515

16-
#include <concepts>
16+
#include <__type_traits/integer_traits.h>
1717

1818
#include "test_macros.h"
1919

@@ -24,40 +24,40 @@ enum SomeEnum {};
2424
enum class SomeScopedEnum {};
2525

2626
// Unsigned
27-
static_assert(std::__libcpp_unsigned_integer<unsigned char>);
28-
static_assert(std::__libcpp_unsigned_integer<unsigned short int>);
29-
static_assert(std::__libcpp_unsigned_integer<unsigned int>);
30-
static_assert(std::__libcpp_unsigned_integer<unsigned long int>);
31-
static_assert(std::__libcpp_unsigned_integer<unsigned long long int>);
32-
static_assert(std::__libcpp_unsigned_integer<unsigned short int>);
27+
static_assert(std::__unsigned_integer<unsigned char>);
28+
static_assert(std::__unsigned_integer<unsigned short int>);
29+
static_assert(std::__unsigned_integer<unsigned int>);
30+
static_assert(std::__unsigned_integer<unsigned long int>);
31+
static_assert(std::__unsigned_integer<unsigned long long int>);
32+
static_assert(std::__unsigned_integer<unsigned short int>);
3333
#if _LIBCPP_HAS_INT128
34-
static_assert(std::__libcpp_unsigned_integer<__uint128_t>);
34+
static_assert(std::__unsigned_integer<__uint128_t>);
3535
#endif
3636
// Signed
37-
static_assert(!std::__libcpp_unsigned_integer<signed char>);
38-
static_assert(!std::__libcpp_unsigned_integer<short int>);
39-
static_assert(!std::__libcpp_unsigned_integer<int>);
40-
static_assert(!std::__libcpp_unsigned_integer<long int>);
41-
static_assert(!std::__libcpp_unsigned_integer<long long int>);
42-
static_assert(!std::__libcpp_unsigned_integer<short int>);
37+
static_assert(!std::__unsigned_integer<signed char>);
38+
static_assert(!std::__unsigned_integer<short int>);
39+
static_assert(!std::__unsigned_integer<int>);
40+
static_assert(!std::__unsigned_integer<long int>);
41+
static_assert(!std::__unsigned_integer<long long int>);
42+
static_assert(!std::__unsigned_integer<short int>);
4343
#if _LIBCPP_HAS_INT128
44-
static_assert(!std::__libcpp_unsigned_integer<__int128_t>);
44+
static_assert(!std::__unsigned_integer<__int128_t>);
4545
#endif
4646
// Non-integer
47-
static_assert(!std::__libcpp_unsigned_integer<bool>);
48-
static_assert(!std::__libcpp_unsigned_integer<char>);
47+
static_assert(!std::__unsigned_integer<bool>);
48+
static_assert(!std::__unsigned_integer<char>);
4949
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
50-
static_assert(!std::__libcpp_unsigned_integer<wchar_t>);
50+
static_assert(!std::__unsigned_integer<wchar_t>);
5151
#endif
52-
static_assert(!std::__libcpp_unsigned_integer<char8_t>);
53-
static_assert(!std::__libcpp_unsigned_integer<char16_t>);
54-
static_assert(!std::__libcpp_unsigned_integer<char32_t>);
55-
static_assert(!std::__libcpp_unsigned_integer<float>);
56-
static_assert(!std::__libcpp_unsigned_integer<double>);
57-
static_assert(!std::__libcpp_unsigned_integer<long double>);
58-
static_assert(!std::__libcpp_unsigned_integer<void>);
59-
static_assert(!std::__libcpp_unsigned_integer<int*>);
60-
static_assert(!std::__libcpp_unsigned_integer<unsigned int*>);
61-
static_assert(!std::__libcpp_unsigned_integer<SomeObject>);
62-
static_assert(!std::__libcpp_unsigned_integer<SomeEnum>);
63-
static_assert(!std::__libcpp_unsigned_integer<SomeScopedEnum>);
52+
static_assert(!std::__unsigned_integer<char8_t>);
53+
static_assert(!std::__unsigned_integer<char16_t>);
54+
static_assert(!std::__unsigned_integer<char32_t>);
55+
static_assert(!std::__unsigned_integer<float>);
56+
static_assert(!std::__unsigned_integer<double>);
57+
static_assert(!std::__unsigned_integer<long double>);
58+
static_assert(!std::__unsigned_integer<void>);
59+
static_assert(!std::__unsigned_integer<int*>);
60+
static_assert(!std::__unsigned_integer<unsigned int*>);
61+
static_assert(!std::__unsigned_integer<SomeObject>);
62+
static_assert(!std::__unsigned_integer<SomeEnum>);
63+
static_assert(!std::__unsigned_integer<SomeScopedEnum>);

0 commit comments

Comments
 (0)
Please sign in to comment.