From 5252677e53ff4473701172bbbd4e953ac6b08e6f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 May 2019 20:49:52 -0700 Subject: [PATCH] [meta] Rewrite hb_int_min/max --- src/hb-meta.hh | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 4cdb77d..16f39eb 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -265,30 +265,30 @@ using hb_is_unsigned = hb_conditional::value template struct hb_int_min; -template <> struct hb_int_min { static constexpr char value = CHAR_MIN; }; -template <> struct hb_int_min { static constexpr signed char value = SCHAR_MIN; }; -template <> struct hb_int_min { static constexpr unsigned char value = 0; }; -template <> struct hb_int_min { static constexpr signed short value = SHRT_MIN; }; -template <> struct hb_int_min { static constexpr unsigned short value = 0; }; -template <> struct hb_int_min { static constexpr signed int value = INT_MIN; }; -template <> struct hb_int_min { static constexpr unsigned int value = 0; }; -template <> struct hb_int_min { static constexpr signed long value = LONG_MIN; }; -template <> struct hb_int_min { static constexpr unsigned long value = 0; }; -template <> struct hb_int_min { static constexpr signed long long value = LLONG_MIN; }; -template <> struct hb_int_min { static constexpr unsigned long long value = 0; }; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; +template <> struct hb_int_min : hb_integral_constant {}; #define hb_int_min(T) hb_int_min::value template struct hb_int_max; -template <> struct hb_int_max { static constexpr char value = CHAR_MAX; }; -template <> struct hb_int_max { static constexpr signed char value = SCHAR_MAX; }; -template <> struct hb_int_max { static constexpr unsigned char value = UCHAR_MAX; }; -template <> struct hb_int_max { static constexpr signed short value = SHRT_MAX; }; -template <> struct hb_int_max { static constexpr unsigned short value = USHRT_MAX; }; -template <> struct hb_int_max { static constexpr signed int value = INT_MAX; }; -template <> struct hb_int_max { static constexpr unsigned int value = UINT_MAX; }; -template <> struct hb_int_max { static constexpr signed long value = LONG_MAX; }; -template <> struct hb_int_max { static constexpr unsigned long value = ULONG_MAX; }; -template <> struct hb_int_max { static constexpr signed long long value = LLONG_MAX; }; -template <> struct hb_int_max { static constexpr unsigned long long value = ULLONG_MAX; }; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; +template <> struct hb_int_max : hb_integral_constant {}; #define hb_int_max(T) hb_int_max::value -- 2.7.4