m[set/map] Add operator bool()

Probably should use in places..
pull/2878/head
Behdad Esfahbod 4 years ago
parent bf75a0a03a
commit 2fbd34f89a
  1. 1
      src/hb-map.hh
  2. 1
      src/hb-set.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; }

@ -273,6 +273,7 @@ struct hb_set_t
return false;
return true;
}
explicit operator bool () const { return !is_empty (); }
void dirty () { population = UINT_MAX; }

Loading…
Cancel
Save