30 #ifndef _GLIBCXX_INT_LIMITS_H
31 #define _GLIBCXX_INT_LIMITS_H 1
33 #pragma GCC system_header
35 #if __cplusplus >= 201103L
38 namespace std _GLIBCXX_VISIBILITY(default)
40 _GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<typename _Tp, bool = is_signed<_Tp>::value>
52 static_assert(is_integral<_Tp>::value,
"unsupported specialization");
53 using _Up =
typename make_unsigned<_Tp>::type;
54 static constexpr
int digits =
sizeof(_Tp) * __CHAR_BIT__ - 1;
55 static constexpr _Tp
min() noexcept {
return _Tp(_Up(1) << digits); }
56 static constexpr _Tp
max() noexcept {
return _Tp(_Up(~_Up(0)) >> 1); }
60 template<
typename _Tp>
61 struct __int_limits<_Tp, false>
63 static_assert(is_integral<_Tp>::value,
"unsupported specialization");
64 static constexpr
int digits =
sizeof(_Tp) * __CHAR_BIT__;
65 static constexpr _Tp
min() noexcept {
return 0; }
66 static constexpr _Tp
max() noexcept {
return _Tp(-1); }
69 template<>
struct __int_limits<bool>;
71 _GLIBCXX_END_NAMESPACE_VERSION
74 #endif // _GLIBCXX_INT_LIMITS_H