From e1dc4920eeb220b5cb3d5f20446748e63b158623 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 Jan 2023 12:11:35 -0700 Subject: [PATCH] [iter] Allow hb_len() to fetch c.len as non-function --- src/hb-iter.hh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index b57f37b13..b123b2f27 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -172,10 +172,16 @@ struct HB_FUNCOBJ (hb_iter); struct { - template unsigned - operator () (T&& c) const - { return c.len (); } + template auto + impl (T&& c, hb_priority<1>) const HB_RETURN (unsigned, c.len ()) + template auto + impl (T&& c, hb_priority<0>) const HB_RETURN (unsigned, c.len) + + public: + + template auto + operator () (T&& c) const HB_RETURN (unsigned, impl (std::forward (c), hb_prioritize)) } HB_FUNCOBJ (hb_len);