diff --git a/src/hb-map.hh b/src/hb-map.hh index a5dedac57..1c2fe145f 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -216,12 +216,16 @@ struct hb_hashmap_t | hb_filter (&item_t::is_real) | hb_map (&item_t::get_pair) ) - auto keys () const HB_AUTO_RETURN ( + iter() | hb_map (&hb_pair_t::first) ) + auto values () const HB_AUTO_RETURN + ( + + iter() + | hb_map (&hb_pair_t::second) + ) protected: diff --git a/src/test-iter.cc b/src/test-iter.cc index 69f2de978..0a0e4d102 100644 --- a/src/test-iter.cc +++ b/src/test-iter.cc @@ -215,6 +215,14 @@ main (int argc, char **argv) using map_key_t = decltype (*m.keys()); + hb_iter (m.keys ()) | hb_filter ([] (map_key_t k) { return k < 42; }) + | hb_drain + ; + + m.values (); + using map_value_t = decltype (*m.values()); + + hb_iter (m.values ()) + | hb_filter ([] (map_value_t k) { return k < 42; }) + | hb_drain ; unsigned int temp1 = 10;