[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.
This commit is contained in:
Nikolas Klauser 2025-06-11 14:33:41 +02:00 committed by GitHub
parent 3c56437eaf
commit b10d711362
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,18 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if __has_builtin(__is_integral)
template <class _Tp>
struct _LIBCPP_NO_SPECIALIZATIONS is_integral : _BoolConstant<__is_integral(_Tp)> {};
# if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_integral_v = __is_integral(_Tp);
# endif
#else
// clang-format off
template <class _Tp> struct __libcpp_is_integral { enum { value = 0 }; };
template <> struct __libcpp_is_integral<bool> { enum { value = 1 }; };
@ -47,18 +59,6 @@ template <> struct __libcpp_is_integral<__uint128_t> { enum { va
#endif
// clang-format on
#if __has_builtin(__is_integral)
template <class _Tp>
struct _LIBCPP_NO_SPECIALIZATIONS is_integral : _BoolConstant<__is_integral(_Tp)> {};
# if _LIBCPP_STD_VER >= 17
template <class _Tp>
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_integral_v = __is_integral(_Tp);
# endif
#else
template <class _Tp>
struct is_integral : public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};