[bit-set-invertible] Implement standard-5 methods & swap

This commit is contained in:
Behdad Esfahbod 2021-11-01 21:07:09 -06:00
parent dcd18da611
commit 11eadb5d28
1 changed files with 11 additions and 3 deletions

View File

@ -35,10 +35,18 @@
struct hb_bit_set_invertible_t
{
hb_bit_set_t s;
bool inverted;
bool inverted = false;
hb_bit_set_invertible_t () { init (); }
~hb_bit_set_invertible_t () { fini (); }
hb_bit_set_invertible_t () = default;
hb_bit_set_invertible_t (hb_bit_set_invertible_t& o) = default;
hb_bit_set_invertible_t (hb_bit_set_invertible_t&& o) = default;
hb_bit_set_invertible_t& operator= (const hb_bit_set_invertible_t& o) = default;
hb_bit_set_invertible_t& operator= (hb_bit_set_invertible_t&& o) = default;
friend void swap (hb_bit_set_invertible_t &a, hb_bit_set_invertible_t &b)
{
hb_swap (a.inverted, b.inverted);
hb_swap (a.s, b.s);
}
void init () { s.init (); inverted = false; }
void fini () { s.fini (); }