From 47333c8a304c6f57f848b5f60eea8ec85ffe2b33 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 7 Jan 2019 21:38:49 -0500 Subject: [PATCH] [iter] Fix operator-> --- src/hb-iter.hh | 3 ++- src/test-iter.cc | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index beb7c93b6..c91740f8d 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -69,7 +69,8 @@ struct hb_iter_t iter_t iter () const { return *thiz(); } explicit_operator bool () const { return thiz()->__more__ (); } unsigned len () const { return thiz()->__len__ (); } - hb_remove_reference (item_t)* operator -> () const { return hb_addressof (*thiz()); } + template + hb_remove_reference (item_t)* operator -> () const { return hb_addressof (**thiz()); } item_t operator * () const { return thiz()->__item__ (); } item_t operator [] (unsigned i) const { return thiz()->__item_at__ (i); } iter_t& operator += (unsigned count) { thiz()->__forward__ (count); return *thiz(); } diff --git a/src/test-iter.cc b/src/test-iter.cc index fbe070838..57568d77f 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -121,5 +121,8 @@ main (int argc, char **argv) test_iterable (); test_iterable (); + hb_array_t > pa; + pa->as_array (); + return 0; }