From 26adefd9eaf4bc1d80b1ffececf0d86f3308f9ee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 May 2019 09:14:44 -0700 Subject: [PATCH] [algs] Try f[v] in hb_get() as last resort --- src/hb-algs.hh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 9e8a4aeba..b83ee6a78 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -100,14 +100,20 @@ struct private: template auto - impl (Proj&& f, Val &&v, hb_priority<1>) const HB_AUTO_RETURN + impl (Proj&& f, Val &&v, hb_priority<2>) const HB_AUTO_RETURN (hb_deref (hb_forward (f)).get (hb_forward (v))) + template auto + impl (Proj&& f, Val &&v, hb_priority<1>) const HB_AUTO_RETURN + ( + hb_invoke (hb_forward (f), + hb_forward (v)) + ) + template auto impl (Proj&& f, Val &&v, hb_priority<0>) const HB_AUTO_RETURN ( - hb_invoke (hb_forward (f), - hb_forward (v)) + hb_forward (f)[hb_forward (v)] ) public: