@@ -108,7 +108,6 @@ template<> class numeric_limits<cv long double>;
108
108
# include < __config>
109
109
# include < __type_traits/is_arithmetic.h>
110
110
# include < __type_traits/is_signed.h>
111
- # include < __type_traits/remove_cv.h>
112
111
113
112
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
114
113
# pragma GCC system_header
@@ -178,16 +177,6 @@ protected:
178
177
static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
179
178
};
180
179
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
-
191
180
template <class _Tp >
192
181
class __libcpp_numeric_limits <_Tp, true > {
193
182
protected:
@@ -199,7 +188,7 @@ protected:
199
188
static _LIBCPP_CONSTEXPR const int digits = static_cast <int >(sizeof (type) * __CHAR_BIT__ - is_signed);
200
189
static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10 ;
201
190
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 ;
203
192
static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0 ) ^ __min) : type(~0 );
204
193
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type min () _NOEXCEPT { return __min; }
205
194
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type max () _NOEXCEPT { return __max; }
@@ -250,10 +239,8 @@ protected:
250
239
static _LIBCPP_CONSTEXPR const int digits = 1 ;
251
240
static _LIBCPP_CONSTEXPR const int digits10 = 0 ;
252
241
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 ; }
257
244
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR type lowest () _NOEXCEPT { return min (); }
258
245
259
246
static _LIBCPP_CONSTEXPR const bool is_integer = true ;
0 commit comments