From f27607580e4d13e8ddf721df971a7d5062c54fb2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 9 Jan 2019 09:03:21 -0800 Subject: [PATCH] [algs] Add hb_first() and hb_second() --- src/hb-dsalgs.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index b5abb6db1..62d979467 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -38,6 +38,8 @@ template struct hb_pair_t { + typedef T1 first_t; + typedef T2 second_t; typedef hb_pair_t pair_t; hb_pair_t (const T1& a, const T2& b) : first (a), second (b) {} @@ -51,6 +53,11 @@ 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; } + +template inline typename Pair::second_t +hb_second (const Pair& pair) { return pair.second; } /* * Bithacks.