m[set/map] Add operator bool()
Probably should use in places..
This commit is contained in:
parent
bf75a0a03a
commit
2fbd34f89a
|
@ -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; }
|
||||
|
||||
|
|
|
@ -273,6 +273,7 @@ struct hb_set_t
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
explicit operator bool () const { return !is_empty (); }
|
||||
|
||||
void dirty () { population = UINT_MAX; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue