From 47afb3ef04c97628d36a129e744b82303b1ca52a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jan 2022 15:26:07 -0700 Subject: [PATCH] [meta] Replace hb_is_pointer with std::is_pointer --- src/hb-algs.hh | 2 +- src/hb-map.hh | 4 ++-- src/hb-meta.hh | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 330d85e56..3edca3344 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -214,7 +214,7 @@ HB_FUNCOBJ (hb_bool); template T hb_coerce (const T v) { return v; } template , hb_decay) && hb_is_pointer(V))> + hb_enable_if (!hb_is_same (hb_decay, hb_decay) && std::is_pointer::value)> T hb_coerce (const V v) { return *v; } struct diff --git a/src/hb-map.hh b/src/hb-map.hh index e58e43a09..bb5531b31 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -37,8 +37,8 @@ template ::value ? hb_int_min (K) : (K) -1, - v_invalid_t vINVALID = hb_is_pointer (V) ? 0 : std::is_signed::value ? hb_int_min (V) : (V) -1> + k_invalid_t kINVALID = std::is_pointer::value ? 0 : std::is_signed::value ? hb_int_min (K) : (K) -1, + v_invalid_t vINVALID = std::is_pointer::value ? 0 : std::is_signed::value ? hb_int_min (V) : (V) -1> struct hb_hashmap_t { hb_hashmap_t () { init (); } diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 0ea5774a9..67f479a5d 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -126,7 +126,6 @@ template using hb_remove_pointer = typename hb_match_pointer::ty template auto _hb_try_add_pointer (hb_priority<1>) -> hb_type_identity*>; template auto _hb_try_add_pointer (hb_priority<1>) -> hb_type_identity; template using hb_add_pointer = decltype (_hb_try_add_pointer (hb_prioritize)); -#define hb_is_pointer(T) hb_match_pointer::value /* TODO Add feature-parity to std::decay. */