From c3a456a26e8e5f8bc483b326f1928e9c603a7216 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 May 2019 20:17:30 -0700 Subject: [PATCH] [meta] Rewrite is_cr_convertible --- src/hb-meta.hh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index ef6d98912..334a44a2a 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -162,14 +162,11 @@ using hb_is_base_of = hb_is_convertible *, hb_decay *>; #define hb_is_base_of(Base,Derived) hb_is_base_of::value template -struct hb_is_cr_convertible -{ - public: - static constexpr bool value = - 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)); -}; +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)) +>; #define hb_is_cr_convertible(From,To) hb_is_cr_convertible::value /* std::move and std::forward */