[iter] Make hb_filter() a function-object
authorBehdad Esfahbod <behdad@fb.com>
Thu, 14 Feb 2019 19:10:13 +0000 (11:10 -0800)
committerBehdad Esfahbod <behdad@fb.com>
Thu, 14 Feb 2019 19:10:13 +0000 (11:10 -0800)
src/hb-iter.hh

index fefd81e..24a10f3 100644 (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() */