diff --git a/libcxx/include/__type_traits/is_floating_point.h b/libcxx/include/__type_traits/is_floating_point.h index b87363fe5b357..17e6e0281a687 100644 --- a/libcxx/include/__type_traits/is_floating_point.h +++ b/libcxx/include/__type_traits/is_floating_point.h @@ -20,18 +20,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD // clang-format off -template struct __libcpp_is_floating_point : false_type {}; -template <> struct __libcpp_is_floating_point : true_type {}; -template <> struct __libcpp_is_floating_point : true_type {}; -template <> struct __libcpp_is_floating_point : true_type {}; +template inline const bool __is_floating_point_impl = false; +template <> inline const bool __is_floating_point_impl = true; +template <> inline const bool __is_floating_point_impl = true; +template <> inline const bool __is_floating_point_impl = true; // clang-format on template -struct _LIBCPP_NO_SPECIALIZATIONS is_floating_point : __libcpp_is_floating_point<__remove_cv_t<_Tp> > {}; +struct _LIBCPP_NO_SPECIALIZATIONS is_floating_point + : integral_constant > > {}; #if _LIBCPP_STD_VER >= 17 -template -_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value; +template +inline constexpr bool is_floating_point_v = __is_floating_point_impl<__remove_cv_t<_Tp>>; #endif _LIBCPP_END_NAMESPACE_STD