diff --git a/src/hb-map.hh b/src/hb-map.hh index 82fa3ccf8..84fe1d549 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -177,6 +177,7 @@ struct hb_hashmap_t } bool is_empty () const { return population == 0; } + explicit operator bool () const { return !is_empty (); } unsigned int get_population () const { return population; } diff --git a/src/hb-set.hh b/src/hb-set.hh index 3b100f609..ae8b5eb10 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -273,6 +273,7 @@ struct hb_set_t return false; return true; } + explicit operator bool () const { return !is_empty (); } void dirty () { population = UINT_MAX; }