[iter] Accept rvalues to hb_enumerate()

This commit is contained in:
Behdad Esfahbod 2019-05-07 22:45:01 -07:00
parent e8bd5fc3fa
commit cf61acb9ea
2 changed files with 3 additions and 1 deletions

View File

@ -529,7 +529,7 @@ struct
template <typename Iterable,
hb_requires (hb_is_iterable (Iterable))>
hb_enumerate_iter_t<hb_iter_t (Iterable)>
operator () (Iterable& it) const
operator () (Iterable&& it) const
{ return hb_enumerate_iter_t<hb_iter_t (Iterable)> (hb_iter (it)); }
}
HB_FUNCOBJ (hb_enumerate);

View File

@ -157,6 +157,8 @@ main (int argc, char **argv)
test_iterator (hb_zip (st, v));
test_iterator_non_default_constructable (hb_enumerate (st));
test_iterator_non_default_constructable (hb_enumerate (hb_iter (st)));
test_iterator_non_default_constructable (hb_enumerate (hb_iter (st) + 1));
test_iterator_non_default_constructable (hb_iter (st) | hb_filter ());
test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_identity));