From 5690840ceb190341f9960d2b975c4366566ae86b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 26 Jul 2023 09:53:32 -0600 Subject: [PATCH] [map] Another try at fixing archaic clang Fixes (?) https://github.com/harfbuzz/harfbuzz/issues/4138 --- src/hb-map.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index e8abeec63..42604ef7c 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -78,6 +78,10 @@ struct hb_hashmap_t hash (0), value () {} + // Needed for https://github.com/harfbuzz/harfbuzz/issues/4138 + K& get_key () { return key; } + V& get_value () { return value; } + bool is_used () const { return is_used_; } void set_used (bool is_used) { is_used_ = is_used; } void set_real (bool is_real) { is_real_ = is_real; } @@ -405,23 +409,21 @@ struct hb_hashmap_t auto keys_ref () const HB_AUTO_RETURN ( + iter_items () - | hb_map (&item_t::key) + | hb_map (&item_t::get_key) ) auto keys () const HB_AUTO_RETURN ( - + iter_items () - | hb_map (&item_t::key) + + keys_ref () | hb_map (hb_ridentity) ) auto values_ref () const HB_AUTO_RETURN ( + iter_items () - | hb_map (&item_t::value) + | hb_map (&item_t::get_value) ) auto values () const HB_AUTO_RETURN ( - + iter_items () - | hb_map (&item_t::value) + + values_ref () | hb_map (hb_ridentity) )