From 792b9b933709d8b271737f863b10aa8714aa1250 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 12 Mar 2025 23:56:52 -0600 Subject: [PATCH] [bit-vector] Add a has() --- src/hb-bit-vector.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-bit-vector.hh b/src/hb-bit-vector.hh index 8bf8f7212..58084e59a 100644 --- a/src/hb-bit-vector.hh +++ b/src/hb-bit-vector.hh @@ -63,7 +63,7 @@ struct hb_bit_vector_t using int_t = uint64_t; using elt_t = typename std::conditional, int_t>::type; - hb_bit_vector_t () = default; + hb_bit_vector_t () = delete; hb_bit_vector_t (const hb_bit_vector_t &other) = delete; hb_bit_vector_t &operator= (const hb_bit_vector_t &other) = delete; @@ -111,6 +111,7 @@ struct hb_bit_vector_t void del (hb_codepoint_t g) { elt (g) &= ~mask (g); } 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 has (hb_codepoint_t g) const { return get (g); } bool may_have (hb_codepoint_t g) const { return get (g); } bool operator [] (hb_codepoint_t g) const { return get (g); }