diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 1a3e2ab3e..5a76c9541 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -324,11 +324,11 @@ template struct hb_map_iter_t : hb_iter_t, - decltype (hb_declval (Proj) (hb_declval (typename Iter::item_t)))> + decltype (hb_get (hb_declval (Proj), *hb_declval (Iter)))> { hb_map_iter_t (const Iter& it, Proj f_) : it (it), f (f_) {} - typedef decltype (hb_declval (Proj) (hb_declval (typename Iter::item_t))) __item_t__; + typedef decltype (hb_get (hb_declval (Proj), *hb_declval (Iter))) __item_t__; static constexpr bool is_random_access_iterator = Iter::is_random_access_iterator; __item_t__ __item__ () const { return hb_get (f.get (), *it); } __item_t__ __item_at__ (unsigned i) const { return hb_get (f.get (), it[i]); } diff --git a/src/test-iter.cc b/src/test-iter.cc index f29166fe8..1e721aecb 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -177,9 +177,14 @@ main (int argc, char **argv) hb_array_t> pa; pa->as_array (); + hb_map_t m; + + hb_iter (src) - | hb_map (hb_identity) + | hb_map (m) + | hb_map (&m) | hb_filter () + | hb_filter (st) + | hb_filter (&st) | hb_filter (hb_bool) | hb_filter (hb_bool, hb_identity) | hb_sink (st)