From 5adb113bafb2cf10ea768ff7a15ad4e6a1270a29 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 26 Jan 2019 22:15:59 +0100 Subject: [PATCH] [meta] Mark function-objects as const --- src/hb-algs.hh | 6 +++--- src/hb-iter.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index b4e79e8ab..85f4f56d5 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -35,7 +35,7 @@ template inline typename T::iter_t hb_iter (const T& c) { return c.iter (); } -static HB_UNUSED struct hb_identity_t +static HB_UNUSED const struct hb_identity_t { template T operator () (const T& v) const { return v; } @@ -59,13 +59,13 @@ struct hb_pair_t template static inline hb_pair_t hb_pair (T1 a, T2 b) { return hb_pair_t (a, b); } -static HB_UNUSED struct hb_first_t +static HB_UNUSED const struct hb_first_t { template typename Pair::first_t operator () (const Pair& pair) const { return pair.first; } } hb_first; -static HB_UNUSED struct hb_second_t +static HB_UNUSED const struct hb_second_t { template typename Pair::second_t operator () (const Pair& pair) const { return pair.second; } diff --git a/src/hb-iter.hh b/src/hb-iter.hh index b538ddf02..da93a5b37 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -280,7 +280,7 @@ struct hb_filter_iter_factory_t Pred p; Proj f; }; -template +template inline hb_filter_iter_factory_t hb_filter (Pred&& p, Proj&& f = hb_identity) { return hb_filter_iter_factory_t (p, f); }