[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;
Proj f;
};
template <typename Pred = decltype ((hb_bool)),
typename Proj = decltype ((hb_identity))>
inline hb_filter_iter_factory_t<Pred, Proj>
hb_filter (Pred&& p = hb_bool, Proj&& f = hb_identity)
{ return hb_filter_iter_factory_t<Pred, Proj> (p, f); }
static const struct
{
template <typename Pred = decltype ((hb_bool)),
typename Proj = decltype ((hb_identity))>
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() */