@@ -108,7 +108,6 @@ template<> class numeric_limits<cv long double>;
108108# include < __config>
109109# include < __type_traits/is_arithmetic.h>
110110# include < __type_traits/is_signed.h>
111- # include < __type_traits/remove_cv.h>
112111
113112# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
114113# pragma GCC system_header
@@ -178,16 +177,6 @@ protected:
178177 static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
179178};
180179
181- template <class _Tp , int __digits, bool _IsSigned>
182- struct __libcpp_compute_min {
183- static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1 ) << __digits);
184- };
185-
186- template <class _Tp , int __digits>
187- struct __libcpp_compute_min <_Tp, __digits, false > {
188- static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0 );
189- };
190-
191180template <class _Tp >
192181class __libcpp_numeric_limits <_Tp, true > {
193182protected:
@@ -199,7 +188,7 @@ protected:
199188 static _LIBCPP_CONSTEXPR const int digits = static_cast <int >(sizeof (type) * __CHAR_BIT__ - is_signed);
200189 static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10 ;
201190 static _LIBCPP_CONSTEXPR const int max_digits10 = 0 ;
202- static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value ;
191+ static _LIBCPP_CONSTEXPR const type __min = is_signed ? _Tp(_Tp( 1 ) << digits) : 0 ;
203192 static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0 ) ^ __min) : type(~0 );
204193 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min () _NOEXCEPT { return __min; }
205194 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max () _NOEXCEPT { return __max; }
@@ -250,10 +239,8 @@ protected:
250239 static _LIBCPP_CONSTEXPR const int digits = 1 ;
251240 static _LIBCPP_CONSTEXPR const int digits10 = 0 ;
252241 static _LIBCPP_CONSTEXPR const int max_digits10 = 0 ;
253- static _LIBCPP_CONSTEXPR const type __min = false ;
254- static _LIBCPP_CONSTEXPR const type __max = true ;
255- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min () _NOEXCEPT { return __min; }
256- [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max () _NOEXCEPT { return __max; }
242+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min () _NOEXCEPT { return false ; }
243+ [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max () _NOEXCEPT { return true ; }
257244 [[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest () _NOEXCEPT { return min (); }
258245
259246 static _LIBCPP_CONSTEXPR const bool is_integer = true ;
0 commit comments