From: Behdad Esfahbod Date: Wed, 8 May 2019 22:32:57 +0000 (-0700) Subject: [map] Return rvalues from keys()/values() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27b2093009745b6c30663605f45ac95deb1562cc;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [map] Return rvalues from keys()/values() --- diff --git a/src/hb-algs.hh b/src/hb-algs.hh index d377772..0db2184 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -43,6 +43,13 @@ HB_FUNCOBJ (hb_identity); struct { + template hb_remove_reference + operator () (T&& v) const { return v; } +} +HB_FUNCOBJ (hb_rvalue); + +struct +{ template bool operator () (T&& v) const { return bool (hb_forward (v)); } } diff --git a/src/hb-map.hh b/src/hb-map.hh index 6eac8c3..2f06595 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -221,12 +221,14 @@ struct hb_hashmap_t + hb_array (items, mask ? mask + 1 : 0) | hb_filter (&item_t::is_real) | hb_map (&item_t::key) + | hb_map (hb_rvalue) ) auto values () const HB_AUTO_RETURN ( + hb_array (items, mask ? mask + 1 : 0) | hb_filter (&item_t::is_real) | hb_map (&item_t::value) + | hb_map (hb_rvalue) ) protected: