summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-08 13:30:26 +0100
committerGitHub <noreply@github.com>2021-11-08 13:30:26 +0100
commit02f9ccf3488eada0a624841376ccf5e6e10cd612 (patch)
treed79358f4ee29b88a99b2245b224906cbb58ee8d0 /thirdparty/harfbuzz/src/hb-bit-set-invertible.hh
parent6c8a1683a559042e8499b8037168749d8086aa63 (diff)
parentda8aedfc171843388a1743b107dea5a98a6ab6eb (diff)
Merge pull request #54586 from bruvzg/hb310
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-bit-set-invertible.hh')
-rw-r--r--thirdparty/harfbuzz/src/hb-bit-set-invertible.hh18
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 (); }