[iter] Fix operator->

This commit is contained in:
Behdad Esfahbod 2019-01-07 21:38:49 -05:00
parent 177a8af380
commit 47333c8a30
2 changed files with 5 additions and 1 deletions

View File

@ -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 <typename U = item_t, hb_enable_if (hb_is_reference (U))>
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(); }

View File

@ -121,5 +121,8 @@ main (int argc, char **argv)
test_iterable<hb_set_t> ();
test_iterable<OT::Coverage> ();
hb_array_t<hb_vector_t<int> > pa;
pa->as_array ();
return 0;
}