diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 105379eea..290e6af3e 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -71,6 +71,10 @@ struct hb_iter_t iter_t operator + () const { return *thiz(); } explicit_operator bool () const { return thiz()->__more__ (); } unsigned len () const { return thiz()->__len__ (); } + /* The following can only be enabled if item_t is reference type. Otherwise + * it will be returning pointer to temporary rvalue. */ + 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); } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 518afaac5..dd6f017b8 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -191,8 +191,8 @@ struct SingleSubstFormat2 for (auto it = hb_zip (this+coverage, substitute) | hb_filter (glyphset, hb_first); it; ++it) { - from.push ()->set (glyph_map[it->first]); - to.push ()->set (glyph_map[it->second]); + from.push ()->set (glyph_map[(*it).first]); + to.push ()->set (glyph_map[(*it).second]); } c->serializer->propagate_error (from, to); SingleSubst_serialize (c->serializer, from, to);