From 4c94bc63d914fac7e11940eb165b6cf1039ba5a1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 May 2019 15:57:33 -0700 Subject: [PATCH] Move hb_invoke() back to hb-algs.hh --- src/hb-algs.hh | 32 ++++++++++++++++++++++++++++++++ src/hb-meta.hh | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 0db2184cf..6adbade15 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -76,6 +76,38 @@ struct } HB_FUNCOBJ (hb_hash); + +struct +{ + private: + + /* Pointer-to-member-function. */ + template auto + impl (Appl&& a, hb_priority<2>, T &&v, Ts&&... ds) const HB_AUTO_RETURN + ((hb_deref (hb_forward (v)).*hb_forward (a)) (hb_forward (ds)...)) + + /* Pointer-to-member. */ + template auto + impl (Appl&& a, hb_priority<1>, T &&v) const HB_AUTO_RETURN + ((hb_deref (hb_forward (v))).*hb_forward (a)) + + /* Operator(). */ + template auto + impl (Appl&& a, hb_priority<0>, Ts&&... ds) const HB_AUTO_RETURN + (hb_deref (hb_forward (a)) (hb_forward (ds)...)) + + public: + + template auto + operator () (Appl&& a, Ts&&... ds) const HB_AUTO_RETURN + ( + impl (hb_forward (a), + hb_prioritize, + hb_forward (ds)...) + ) +} +HB_FUNCOBJ (hb_invoke); + struct { private: diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 421eb0638..4e5e5d94f 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -212,36 +212,4 @@ template <> struct hb_is_integer { enum { value = true }; }; #define hb_is_integer(T) hb_is_integer::value -struct -{ - private: - - /* Pointer-to-member-function. */ - template auto - impl (Appl&& a, hb_priority<2>, T &&v, Ts&&... ds) const HB_AUTO_RETURN - ((hb_deref (hb_forward (v)).*hb_forward (a)) (hb_forward (ds)...)) - - /* Pointer-to-member. */ - template auto - impl (Appl&& a, hb_priority<1>, T &&v) const HB_AUTO_RETURN - ((hb_deref (hb_forward (v))).*hb_forward (a)) - - /* Operator(). */ - template auto - impl (Appl&& a, hb_priority<0>, Ts&&... ds) const HB_AUTO_RETURN - (hb_deref (hb_forward (a)) (hb_forward (ds)...)) - - public: - - template auto - operator () (Appl&& a, Ts&&... ds) const HB_AUTO_RETURN - ( - impl (hb_forward (a), - hb_prioritize, - hb_forward (ds)...) - ) -} -HB_FUNCOBJ (hb_invoke); - - #endif /* HB_META_HH */