18 template<
typename T >
struct numeric_limits;
19 template<>
struct numeric_limits<bool>
21 static constexpr bool min() {
return false; }
22 static constexpr bool max() {
return true; }
24 template<>
struct numeric_limits<char>
26 static constexpr signed char min() {
return SCHAR_MIN; }
27 static constexpr signed char max() {
return SCHAR_MAX; }
29 template<>
struct numeric_limits<unsigned char>
31 static constexpr unsigned char min() {
return 0; }
32 static constexpr unsigned char max() {
return UCHAR_MAX; }
34 template<>
struct numeric_limits<signed short int>
36 static constexpr signed short int min() {
return SHRT_MIN; }
37 static constexpr signed short int max() {
return SHRT_MAX; }
39 template<>
struct numeric_limits<unsigned short int>
41 static constexpr unsigned short int min() {
return 0; }
42 static constexpr unsigned short int max() {
return USHRT_MAX; }
44 template<>
struct numeric_limits<signed int>
46 static constexpr signed int min() {
return INT_MIN; }
47 static constexpr signed int max() {
return INT_MAX; }
49 template<>
struct numeric_limits<unsigned int>
51 static constexpr unsigned int min() {
return 0U; }
52 static constexpr unsigned int max() {
return UINT_MAX; }
54 template<>
struct numeric_limits<signed long int>
56 static constexpr signed long min() {
return LONG_MIN; }
57 static constexpr signed long max() {
return LONG_MAX; }
59 template<>
struct numeric_limits<unsigned long int>
61 static constexpr unsigned long int min() {
return 0UL; }
62 static constexpr unsigned long int max() {
return ULONG_MAX; }
64 template<>
struct numeric_limits<signed long long int>
66 static constexpr signed long long min() {
return LLONG_MIN; }
67 static constexpr signed long long max() {
return LLONG_MAX; }
69 template<>
struct numeric_limits<unsigned long long int>
71 static constexpr unsigned long long min() {
return 0ULL; }
72 static constexpr unsigned long long max() {
return ULLONG_MAX; }
76 static constexpr long min() {
return -max() - 1L; }
77 static constexpr long max() {
return numeric_limits<long>::max() >> 16; }