[iter] Make hb_filter() a function-object

This commit is contained in:
Behdad Esfahbod 2019-02-14 11:10:13 -08:00
parent aa4c321262
commit 00db94095d
1 changed files with 8 additions and 5 deletions

View File

@ -322,11 +322,14 @@ struct hb_filter_iter_factory_t
Pred p; Pred p;
Proj f; Proj f;
}; };
template <typename Pred = decltype ((hb_bool)), static const struct
typename Proj = decltype ((hb_identity))> {
inline hb_filter_iter_factory_t<Pred, Proj> template <typename Pred = decltype ((hb_bool)),
hb_filter (Pred&& p = hb_bool, Proj&& f = hb_identity) typename Proj = decltype ((hb_identity))>
{ return hb_filter_iter_factory_t<Pred, Proj> (p, f); } hb_filter_iter_factory_t<Pred, Proj>
operator () (Pred&& p = hb_bool, Proj&& f = hb_identity) const
{ return hb_filter_iter_factory_t<Pred, Proj> (p, f); }
} hb_filter HB_UNUSED;
/* hb_zip() */ /* hb_zip() */