From 7cedf7f64c2be0d16771dba73fd370325f7b66a1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 9 Jan 2019 12:22:14 -0800 Subject: [PATCH] Change hb_first() and hb_second() to function objects --- src/hb-algs.hh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 95adc2723..7b911fa90 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -53,11 +53,17 @@ struct hb_pair_t template static inline hb_pair_t hb_pair (T1 a, T2 b) { return hb_pair_t (a, b); } -template inline typename Pair::first_t -hb_first (const Pair& pair) { return pair.first; } +static struct +{ + template typename Pair::first_t + operator () (const Pair& pair) { return pair.first; } +} hb_first; -template inline typename Pair::second_t -hb_second (const Pair& pair) { return pair.second; } +static struct +{ + template typename Pair::second_t + operator () (const Pair& pair) { return pair.second; } +} hb_second; /*