From 2778df7972f537192b51cd0719adf2ab4d1f3397 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 3 Apr 2019 14:15:01 -0700 Subject: [PATCH] [meta] Add hb_is_same() --- src/hb-meta.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 63c8a8cf5..c0095637e 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -92,15 +92,18 @@ template struct hb_bool_tt { enum { value = b }; }; typedef hb_bool_tt hb_true_t; typedef hb_bool_tt hb_false_t; - template struct hb_enable_if {}; - template struct hb_enable_if { typedef T type; }; - #define hb_enable_if(Cond) typename hb_enable_if<(Cond)>::type* = nullptr +template +struct hb_is_same : hb_false_t {}; +template +struct hb_is_same : hb_true_t {}; +#define hb_is_same(T, T2) hb_is_same::value + /* * Meta-functions.