From 3919ca41b5e657764c7f75dfdc21cf8ca20bd66f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 May 2019 19:56:36 -0700 Subject: [PATCH] [meta] Add is_floating_point --- src/hb-meta.hh | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index f13b256ee..d995607f4 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -228,6 +228,25 @@ struct hb_reference_wrapper }; +template struct hb_is_integral { static constexpr bool value = false;}; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; +template <> struct hb_is_integral { static constexpr bool value = true; }; + +template struct hb_is_floating_point { static constexpr bool value = false;}; +template <> struct hb_is_floating_point { static constexpr bool value = true; }; +template <> struct hb_is_floating_point { static constexpr bool value = true; }; +template <> struct hb_is_floating_point { static constexpr bool value = true; }; + +#define hb_is_integral(T) hb_is_integral::value template struct hb_is_signed; template <> struct hb_is_signed { static constexpr bool value = CHAR_MIN < 0; }; template <> struct hb_is_signed { static constexpr bool value = true; }; @@ -277,19 +296,5 @@ template <> struct hb_signedness_int { typedef unsigned int value; }; template <> struct hb_signedness_int { typedef signed int value; }; #define hb_signedness_int(T) hb_signedness_int::value -template struct hb_is_integral { static constexpr bool value = false;}; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -template <> struct hb_is_integral { static constexpr bool value = true; }; -#define hb_is_integral(T) hb_is_integral::value - #endif /* HB_META_HH */