Skip to content

[libc++][NFC] Move __libcpp_is_integral into the else branch #142556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions libcxx/include/__type_traits/is_integral.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 }; };
Expand Down Expand Up @@ -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> {};

Expand Down
Loading