From 11eadb5d2886c8d2a6eef26866f080bde9ff65ce Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 1 Nov 2021 21:07:09 -0600 Subject: [PATCH] [bit-set-invertible] Implement standard-5 methods & swap --- src/hb-bit-set-invertible.hh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hb-bit-set-invertible.hh b/src/hb-bit-set-invertible.hh index f48b72fe6..978d589ab 100644 --- a/src/hb-bit-set-invertible.hh +++ b/src/hb-bit-set-invertible.hh @@ -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 (); }