[map] Return rvalues from keys()/values()

This commit is contained in:
Behdad Esfahbod 2019-05-08 15:32:57 -07:00
parent 372c5b97bf
commit 27b2093009
2 changed files with 9 additions and 0 deletions

View File

@ -41,6 +41,13 @@ struct
} }
HB_FUNCOBJ (hb_identity); HB_FUNCOBJ (hb_identity);
struct
{
template <typename T> hb_remove_reference<T>
operator () (T&& v) const { return v; }
}
HB_FUNCOBJ (hb_rvalue);
struct struct
{ {
template <typename T> bool template <typename T> bool

View File

@ -221,12 +221,14 @@ struct hb_hashmap_t
+ hb_array (items, mask ? mask + 1 : 0) + hb_array (items, mask ? mask + 1 : 0)
| hb_filter (&item_t::is_real) | hb_filter (&item_t::is_real)
| hb_map (&item_t::key) | hb_map (&item_t::key)
| hb_map (hb_rvalue)
) )
auto values () const HB_AUTO_RETURN auto values () const HB_AUTO_RETURN
( (
+ hb_array (items, mask ? mask + 1 : 0) + hb_array (items, mask ? mask + 1 : 0)
| hb_filter (&item_t::is_real) | hb_filter (&item_t::is_real)
| hb_map (&item_t::value) | hb_map (&item_t::value)
| hb_map (hb_rvalue)
) )
protected: protected: