[iter] Accept rvalues to hb_enumerate()
This commit is contained in:
parent
e8bd5fc3fa
commit
cf61acb9ea
|
@ -529,7 +529,7 @@ struct
|
||||||
template <typename Iterable,
|
template <typename Iterable,
|
||||||
hb_requires (hb_is_iterable (Iterable))>
|
hb_requires (hb_is_iterable (Iterable))>
|
||||||
hb_enumerate_iter_t<hb_iter_t (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)); }
|
{ return hb_enumerate_iter_t<hb_iter_t (Iterable)> (hb_iter (it)); }
|
||||||
}
|
}
|
||||||
HB_FUNCOBJ (hb_enumerate);
|
HB_FUNCOBJ (hb_enumerate);
|
||||||
|
|
|
@ -157,6 +157,8 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
test_iterator (hb_zip (st, v));
|
test_iterator (hb_zip (st, v));
|
||||||
test_iterator_non_default_constructable (hb_enumerate (st));
|
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_filter ());
|
||||||
test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_identity));
|
test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_identity));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue