[map] Add .values() iterator
diff --git a/src/hb-map.hh b/src/hb-map.hh
index a5dedac..1c2fe14 100644
--- a/src/hb-map.hh
+++ b/src/hb-map.hh
@@ -216,12 +216,16 @@
| hb_filter (&item_t::is_real)
| hb_map (&item_t::get_pair)
)
-
auto keys () const HB_AUTO_RETURN
(
+ iter()
| hb_map (&hb_pair_t<K, V>::first)
)
+ auto values () const HB_AUTO_RETURN
+ (
+ + iter()
+ | hb_map (&hb_pair_t<K, V>::second)
+ )
protected:
diff --git a/src/test-iter.cc b/src/test-iter.cc
index 69f2de9..0a0e4d1 100644
--- a/src/test-iter.cc
+++ b/src/test-iter.cc
@@ -215,6 +215,14 @@
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;