diff --git a/src/hb-iter.hh b/src/hb-iter.hh index ee8e9b95d..7b147fbbe 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -210,7 +210,7 @@ template , decltype (hb_declval (Proj) (hb_declval (typename Iter::item_t)))> { - hb_map_iter_t (const Iter& it, Proj f) : it (it), f (f) {} + hb_map_iter_t (const Iter& it, Proj&& f) : it (it), f (f) {} typedef decltype (hb_declval (Proj) (hb_declval (typename Iter::item_t))) __item_t__; enum { is_random_access_iterator = Iter::is_random_access_iterator }; @@ -230,7 +230,7 @@ struct hb_map_iter_t : template struct hb_map_iter_factory_t { - hb_map_iter_factory_t (Proj f) : f (f) {} + hb_map_iter_factory_t (Proj&& f) : f (f) {} template @@ -242,7 +242,7 @@ struct hb_map_iter_factory_t }; template inline hb_map_iter_factory_t -hb_map (Proj f) +hb_map (Proj&& f) { return hb_map_iter_factory_t (f); } template , typename Iter::item_t>, hb_iter_mixin_t, typename Iter::item_t> { - hb_filter_iter_t (const Iter& it_, Pred p, Proj f) : it (it_), p (p), f (f) + hb_filter_iter_t (const Iter& it_, Pred&& p, Proj&& f) : it (it_), p (p), f (f) { while (it && !p (f (*it))) ++it; } typedef typename Iter::item_t __item_t__; @@ -269,7 +269,7 @@ struct hb_filter_iter_t : template struct hb_filter_iter_factory_t { - hb_filter_iter_factory_t (Pred p, Proj f) : p (p), f (f) {} + hb_filter_iter_factory_t (Pred&& p, Proj&& f) : p (p), f (f) {} template @@ -282,7 +282,7 @@ struct hb_filter_iter_factory_t }; template inline hb_filter_iter_factory_t -hb_filter (Pred p, Proj f) +hb_filter (Pred&& p, Proj&& f) { return hb_filter_iter_factory_t (p, f); } /* hb_zip() */