diff options
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-bit-set-invertible.hh')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-bit-set-invertible.hh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh b/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh index f48b72fe63..0832b0fc23 100644 --- a/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh +++ b/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh @@ -35,10 +35,20 @@ struct hb_bit_set_invertible_t { hb_bit_set_t s; - bool inverted; - - hb_bit_set_invertible_t () { init (); } - ~hb_bit_set_invertible_t () { fini (); } + bool inverted = false; + + 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) + { + if (likely (!a.s.successful || !b.s.successful)) + return; + hb_swap (a.inverted, b.inverted); + hb_swap (a.s, b.s); + } void init () { s.init (); inverted = false; } void fini () { s.fini (); } |