[bit-page] Add a couple of operators

This commit is contained in:
Behdad Esfahbod committed 2025-02-05 10:42:33 +00:00
1 parent 37bfdf79c6
commit dc4ff7012c
1 file changed
+5
+5
View File
@@ -89,6 +89,8 @@ struct hb_vector_size_t
struct hb_bit_page_t
{
hb_bit_page_t () { init0 (); }
void init0 () { v.init0 (); population = 0; }
void init1 () { v.init1 (); population = PAGE_BITS; }
@@ -116,6 +118,9 @@ struct hb_bit_page_t
void set (hb_codepoint_t g, bool value) { if (value) add (g); else del (g); }
bool get (hb_codepoint_t g) const { return elt (g) & mask (g); }
bool operator [] (hb_codepoint_t g) const { return get (g); }
bool operator () (hb_codepoint_t g) const { return get (g); }
void add_range (hb_codepoint_t a, hb_codepoint_t b)
{
elt_t *la = &elt (a);