diff --git a/src/hb-array.hh b/src/hb-array.hh index 9b9f85854..fd3bd4450 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -41,6 +41,8 @@ struct hb_bytes_t operator const void * (void) const { return arrayZ; } operator const char * (void) const { return arrayZ; } + explicit_operator bool (void) const { return len; } + void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } int cmp (const hb_bytes_t &a) const @@ -80,6 +82,8 @@ struct hb_array_t return arrayZ[i]; } + explicit_operator bool (void) const { return len; } + template operator T * (void) const { return arrayZ; } Type * operator & (void) const { return arrayZ; } diff --git a/src/hb-iter.hh b/src/hb-iter.hh index b697ef990..5b6cbc4ea 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -72,7 +72,7 @@ struct Iter array (array_), length (length_) {} /* Emptiness. */ - explicit_operator bool (void) const { return bool (length); } + explicit_operator bool (void) const { return length; } /* Current item. */ T &operator * (void)