[map] Try to fix build with old clang, again

https://github.com/harfbuzz/harfbuzz/issues/4138
This commit is contained in:
Behdad Esfahbod 2023-03-15 17:58:02 -06:00
parent 09a2662361
commit cd7be13059
1 changed files with 13 additions and 11 deletions

View File

@ -290,7 +290,8 @@ struct hb_hashmap_t
uint32_t hash () const uint32_t hash () const
{ {
return return
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_reduce ([] (uint32_t h, const item_t &_) { return h ^ _.total_hash (); }, (uint32_t) 0u) | hb_reduce ([] (uint32_t h, const item_t &_) { return h ^ _.total_hash (); }, (uint32_t) 0u)
; ;
} }
@ -321,40 +322,41 @@ struct hb_hashmap_t
* Iterator * Iterator
*/ */
auto iter_items () const HB_AUTO_RETURN auto iter_ref () const HB_AUTO_RETURN
( (
+ hb_iter (items, size ()) + hb_iter (items, size ())
| hb_filter (&item_t::is_real) | hb_filter (&item_t::is_real)
)
auto iter_ref () const HB_AUTO_RETURN
(
+ iter_items ()
| hb_map (&item_t::get_pair_ref) | hb_map (&item_t::get_pair_ref)
) )
auto iter () const HB_AUTO_RETURN auto iter () const HB_AUTO_RETURN
( (
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_map (&item_t::get_pair) | hb_map (&item_t::get_pair)
) )
auto keys_ref () const HB_AUTO_RETURN auto keys_ref () const HB_AUTO_RETURN
( (
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_map (&item_t::key) | hb_map (&item_t::key)
) )
auto keys () const HB_AUTO_RETURN auto keys () const HB_AUTO_RETURN
( (
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_map (&item_t::key) | hb_map (&item_t::key)
| hb_map (hb_ridentity) | hb_map (hb_ridentity)
) )
auto values_ref () const HB_AUTO_RETURN auto values_ref () const HB_AUTO_RETURN
( (
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_map (&item_t::value) | hb_map (&item_t::value)
) )
auto values () const HB_AUTO_RETURN auto values () const HB_AUTO_RETURN
( (
+ iter_items () + hb_iter (items, size ())
| hb_filter (&item_t::is_real)
| hb_map (&item_t::value) | hb_map (&item_t::value)
| hb_map (hb_ridentity) | hb_map (hb_ridentity)
) )