|
|
|
@ -42,6 +42,7 @@ template <typename K, typename V, |
|
|
|
|
struct hb_hashmap_t |
|
|
|
|
{ |
|
|
|
|
hb_hashmap_t () { init (); } |
|
|
|
|
hb_hashmap_t (std::nullptr_t) : hb_hashmap_t () {} |
|
|
|
|
~hb_hashmap_t () { fini (); } |
|
|
|
|
|
|
|
|
|
hb_hashmap_t (const hb_hashmap_t& o) : hb_hashmap_t () { resize (population); hb_copy (o, *this); } |
|
|
|
@ -238,6 +239,19 @@ struct hb_hashmap_t |
|
|
|
|
bool is_empty () const { return population == 0; } |
|
|
|
|
explicit operator bool () const { return !is_empty (); } |
|
|
|
|
|
|
|
|
|
bool is_equal (const hb_hashmap_t &other) const |
|
|
|
|
{ |
|
|
|
|
if (population != other.population) return false; |
|
|
|
|
|
|
|
|
|
for (auto pair : iter ()) |
|
|
|
|
if (get (pair.first) != pair.second) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
bool operator == (const hb_hashmap_t &other) const { return is_equal (other); } |
|
|
|
|
bool operator != (const hb_hashmap_t &other) const { return !is_equal (other); } |
|
|
|
|
|
|
|
|
|
unsigned int get_population () const { return population; } |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -394,6 +408,7 @@ struct hb_map_t : hb_hashmap_t<hb_codepoint_t, |
|
|
|
|
|
|
|
|
|
~hb_map_t () = default; |
|
|
|
|
hb_map_t () : hashmap () {} |
|
|
|
|
hb_map_t (std::nullptr_t) : hb_map_t () {} |
|
|
|
|
hb_map_t (const hb_map_t &o) : hashmap ((hashmap &) o) {} |
|
|
|
|
hb_map_t (hb_map_t &&o) : hashmap (std::move ((hashmap &) o)) {} |
|
|
|
|
hb_map_t& operator= (const hb_map_t&) = default; |
|
|
|
|