[array] Minor
This commit is contained in:
parent
5a552f7546
commit
aa8f94714e
|
@ -41,6 +41,8 @@ struct hb_bytes_t
|
||||||
operator const void * (void) const { return arrayZ; }
|
operator const void * (void) const { return arrayZ; }
|
||||||
operator const char * (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; }
|
void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; }
|
||||||
|
|
||||||
int cmp (const hb_bytes_t &a) const
|
int cmp (const hb_bytes_t &a) const
|
||||||
|
@ -80,6 +82,8 @@ struct hb_array_t
|
||||||
return arrayZ[i];
|
return arrayZ[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit_operator bool (void) const { return len; }
|
||||||
|
|
||||||
template <typename T> operator T * (void) const { return arrayZ; }
|
template <typename T> operator T * (void) const { return arrayZ; }
|
||||||
|
|
||||||
Type * operator & (void) const { return arrayZ; }
|
Type * operator & (void) const { return arrayZ; }
|
||||||
|
|
|
@ -72,7 +72,7 @@ struct Iter<T *>
|
||||||
array (array_), length (length_) {}
|
array (array_), length (length_) {}
|
||||||
|
|
||||||
/* Emptiness. */
|
/* Emptiness. */
|
||||||
explicit_operator bool (void) const { return bool (length); }
|
explicit_operator bool (void) const { return length; }
|
||||||
|
|
||||||
/* Current item. */
|
/* Current item. */
|
||||||
T &operator * (void)
|
T &operator * (void)
|
||||||
|
|
Loading…
Reference in New Issue