[arrays] Add as_array() to hb_vector_t<>

This commit is contained in:
Behdad Esfahbod 2018-11-23 16:07:43 -05:00
parent c514f65181
commit 04f7e55369
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ struct hb_vector_t
return arrayZ()[i];
}
inline hb_array_t<Type> as_array (void) { return hb_array_t<Type> (arrayZ(), len); }
inline hb_array_t<const Type> as_array (void) const { return hb_array_t<const Type> (arrayZ(), len); }
template <typename T> inline operator T * (void) { return arrayZ(); }
template <typename T> inline operator const T * (void) const { return arrayZ(); }