From 04f7e5536924e7f277d72b8cb9d878239877c331 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 Nov 2018 16:07:43 -0500 Subject: [PATCH] [arrays] Add as_array() to hb_vector_t<> --- src/hb-vector.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index 7056a5b54..c1f680ed8 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -89,6 +89,9 @@ struct hb_vector_t return arrayZ()[i]; } + inline hb_array_t as_array (void) { return hb_array_t (arrayZ(), len); } + inline hb_array_t as_array (void) const { return hb_array_t (arrayZ(), len); } + template inline operator T * (void) { return arrayZ(); } template inline operator const T * (void) const { return arrayZ(); }