From 909dde9df1b93a508258461ff8e00c5f6604f07b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Jan 2022 15:30:10 -0700 Subject: [PATCH] [meta] Use std::is_reference instead of hb_is_reference --- src/hb-iter.hh | 2 +- src/hb-meta.hh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index ad2e45e3c..e067d2b9a 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -90,7 +90,7 @@ struct hb_iter_t * it will be returning pointer to temporary rvalue. * TODO Use a wrapper return type to fix for non-reference type. */ template + hb_enable_if (std::is_reference::value)> hb_remove_reference* operator -> () const { return hb_addressof (**thiz()); } item_t operator * () const { return thiz()->__item__ (); } item_t operator * () { return thiz()->__item__ (); } diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 67f479a5d..67f9f429f 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -109,6 +109,7 @@ template struct hb_match_const : hb_type_identity_t, hb template using hb_remove_const = typename hb_match_const::type; template using hb_add_const = const T; #define hb_is_const(T) hb_match_const::value + template struct hb_match_reference : hb_type_identity_t, hb_false_type {}; template struct hb_match_reference : hb_type_identity_t, hb_true_type {}; template struct hb_match_reference : hb_type_identity_t, hb_true_type {}; @@ -119,7 +120,7 @@ template using hb_add_lvalue_reference = decltype (_hb_try_add_lval template auto _hb_try_add_rvalue_reference (hb_priority<1>) -> hb_type_identity; template auto _hb_try_add_rvalue_reference (hb_priority<0>) -> hb_type_identity; template using hb_add_rvalue_reference = decltype (_hb_try_add_rvalue_reference (hb_prioritize)); -#define hb_is_reference(T) hb_match_reference::value + template struct hb_match_pointer : hb_type_identity_t, hb_false_type {}; template struct hb_match_pointer : hb_type_identity_t, hb_true_type {}; template using hb_remove_pointer = typename hb_match_pointer::type; @@ -137,7 +138,7 @@ template using hb_is_cr_convertible = hb_bool_constant< hb_is_same (hb_decay, hb_decay) && (!hb_is_const (From) || hb_is_const (To)) && - (!hb_is_reference (To) || hb_is_const (To) || hb_is_reference (To)) + (!std::is_reference::value || hb_is_const (To) || std::is_reference::value) >; #define hb_is_cr_convertible(From,To) hb_is_cr_convertible::value