20 template<
typename T >
struct numeric_limits;
21 template<>
struct numeric_limits<bool>
23 static constexpr bool min() {
return false; }
24 static constexpr bool max() {
return true; }
26 template<>
struct numeric_limits<char>
28 static constexpr char min() {
return CHAR_MIN; }
29 static constexpr char max() {
return CHAR_MAX; }
31 template<>
struct numeric_limits<signed char>
33 static constexpr signed char min() {
return SCHAR_MIN; }
34 static constexpr signed char max() {
return SCHAR_MAX; }
36 template<>
struct numeric_limits<unsigned char>
38 static constexpr unsigned char min() {
return 0; }
39 static constexpr unsigned char max() {
return UCHAR_MAX; }
41 template<>
struct numeric_limits<signed short int>
43 static constexpr signed short int min() {
return SHRT_MIN; }
44 static constexpr signed short int max() {
return SHRT_MAX; }
46 template<>
struct numeric_limits<unsigned short int>
48 static constexpr unsigned short int min() {
return 0; }
49 static constexpr unsigned short int max() {
return USHRT_MAX; }
51 template<>
struct numeric_limits<signed int>
53 static constexpr signed int min() {
return INT_MIN; }
54 static constexpr signed int max() {
return INT_MAX; }
56 template<>
struct numeric_limits<unsigned int>
58 static constexpr unsigned int min() {
return 0U; }
59 static constexpr unsigned int max() {
return UINT_MAX; }
61 template<>
struct numeric_limits<signed long int>
63 static constexpr signed long min() {
return LONG_MIN; }
64 static constexpr signed long max() {
return LONG_MAX; }
66 template<>
struct numeric_limits<unsigned long int>
68 static constexpr unsigned long int min() {
return 0UL; }
69 static constexpr unsigned long int max() {
return ULONG_MAX; }
71 template<>
struct numeric_limits<signed long long int>
73 static constexpr signed long long min() {
return LLONG_MIN; }
74 static constexpr signed long long max() {
return LLONG_MAX; }
76 template<>
struct numeric_limits<unsigned long long int>
78 static constexpr unsigned long long min() {
return 0ULL; }
79 static constexpr unsigned long long max() {
return ULLONG_MAX; }
83 static constexpr long min() {
return -max() - 1L; }
84 static constexpr long max() {
return numeric_limits<long>::max() >> 16; }