Skip to content

Commit b10d711

Browse files
authored
[libc++][NFC] Move __libcpp_is_integral into the else branch (#142556)
This makes it clear that `__libcpp_is_integral` is an implementation detail of `is_integral` if we don't have `__is_integral` and not its own utility.
1 parent 3c56437 commit b10d711

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

libcxx/include/__type_traits/is_integral.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919

2020
_LIBCPP_BEGIN_NAMESPACE_STD
2121

22+
#if __has_builtin(__is_integral)
23+
24+
template <class _Tp>
25+
struct _LIBCPP_NO_SPECIALIZATIONS is_integral : _BoolConstant<__is_integral(_Tp)> {};
26+
27+
# if _LIBCPP_STD_VER >= 17
28+
template <class _Tp>
29+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_integral_v = __is_integral(_Tp);
30+
# endif
31+
32+
#else
33+
2234
// clang-format off
2335
template <class _Tp> struct __libcpp_is_integral { enum { value = 0 }; };
2436
template <> struct __libcpp_is_integral<bool> { enum { value = 1 }; };
@@ -47,18 +59,6 @@ template <> struct __libcpp_is_integral<__uint128_t> { enum { va
4759
#endif
4860
// clang-format on
4961

50-
#if __has_builtin(__is_integral)
51-
52-
template <class _Tp>
53-
struct _LIBCPP_NO_SPECIALIZATIONS is_integral : _BoolConstant<__is_integral(_Tp)> {};
54-
55-
# if _LIBCPP_STD_VER >= 17
56-
template <class _Tp>
57-
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_integral_v = __is_integral(_Tp);
58-
# endif
59-
60-
#else
61-
6262
template <class _Tp>
6363
struct is_integral : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
6464

0 commit comments

Comments
 (0)