From fd75d29f0f317c4fb36b093c8fabf2a7dcd28042 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 27 Dec 2018 16:29:22 -0500 Subject: [PATCH] [iter] Streamline vector iterators --- src/hb-vector.hh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hb-vector.hh b/src/hb-vector.hh index ec7f0e96d..5a2c7bf46 100644 --- a/src/hb-vector.hh +++ b/src/hb-vector.hh @@ -89,18 +89,17 @@ struct hb_vector_t explicit_operator bool () const { return length; } - hb_array_t as_array () - { return hb_array (arrayZ(), length); } - hb_array_t as_array () const - { return hb_array (arrayZ(), length); } + hb_array_t< Type> as_array () { return hb_array (arrayZ(), length); } + hb_array_t as_array () const { return hb_array (arrayZ(), length); } /* Iterator. */ - typedef hb_array_t iter_t; - iter_t iter () { return as_array (); } - operator iter_t () { return iter (); } typedef hb_array_t const_iter_t; + typedef hb_array_t< Type> iter_t; + const_iter_t iter () const { return as_array (); } const_iter_t citer () const { return as_array (); } - operator const_iter_t () const { return citer (); } + iter_t iter () { return as_array (); } + operator iter_t () { return iter (); } + operator const_iter_t () const { return iter (); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);}