summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-11-04 00:51:18 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-11-04 00:51:18 +0000
commitd8e6485451c14d7d04f277251b9f5a6ad7414bd6 (patch)
treebe5deebf5d46cf01c9b84a59b7cf6423b60c13fb /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh
parent2acbcbdbdcd3595121315ed3ee613c2b946f13d5 (diff)
harfbuzz 3.1.0
git-svn-id: svn://tug.org/texlive/trunk@60943 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh25
1 files changed, 17 insertions, 8 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh
index c21778d88e7..a471ee48b5f 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-bit-set.hh
@@ -35,13 +35,22 @@
struct hb_bit_set_t
{
- hb_bit_set_t () { init (); }
- ~hb_bit_set_t () { fini (); }
+ hb_bit_set_t () = default;
+ ~hb_bit_set_t () = default;
hb_bit_set_t (const hb_bit_set_t& other) : hb_bit_set_t () { set (other); }
- void operator= (const hb_bit_set_t& other) { set (other); }
- // TODO Add move construtor/assign
- // TODO Add constructor for Iterator; with specialization for (sorted) vector / array?
+ hb_bit_set_t ( hb_bit_set_t&& other) : hb_bit_set_t () { hb_swap (*this, other); }
+ hb_bit_set_t& operator= (const hb_bit_set_t& other) { set (other); return *this; }
+ hb_bit_set_t& operator= (hb_bit_set_t&& other) { hb_swap (*this, other); return *this; }
+ friend void swap (hb_bit_set_t &a, hb_bit_set_t &b)
+ {
+ if (likely (!a.successful || !b.successful))
+ return;
+ hb_swap (a.population, b.population);
+ hb_swap (a.last_page_lookup, b.last_page_lookup);
+ hb_swap (a.page_map, b.page_map);
+ hb_swap (a.pages, b.pages);
+ }
void init ()
{
@@ -67,9 +76,9 @@ struct hb_bit_set_t
uint32_t index;
};
- bool successful; /* Allocations successful */
- mutable unsigned int population;
- mutable unsigned int last_page_lookup;
+ bool successful = true; /* Allocations successful */
+ mutable unsigned int population = 0;
+ mutable unsigned int last_page_lookup = 0;
hb_sorted_vector_t<page_map_t> page_map;
hb_vector_t<page_t> pages;