m[set/map] Add operator bool()

Probably should use in places..
This commit is contained in:
Behdad Esfahbod committed 2021-02-19 18:40:48 -07:00
1 parent bf75a0a03a
commit 2fbd34f89a
2 files changed
+2

No files matched your search

+1
View File
@@ -177,6 +177,7 @@ struct hb_hashmap_t
}
bool is_empty () const { return population == 0; }
explicit operator bool () const { return !is_empty (); }
unsigned int get_population () const { return population; }
+1
View File
@@ -273,6 +273,7 @@ struct hb_set_t
return false;
return true;
}
explicit operator bool () const { return !is_empty (); }
void dirty () { population = UINT_MAX; }