From: Behdad Esfahbod Date: Wed, 8 May 2019 05:29:40 +0000 (-0700) Subject: [meta] Move hb_invoke from algs to meta X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8bd5fc3fa2cc5c5f8f254629553902aed3496ba;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [meta] Move hb_invoke from algs to meta --- diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 3b5e45f..7738245 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -73,37 +73,6 @@ 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: - template auto impl (Pred&& p, Val &&v, hb_priority<1>) const HB_AUTO_RETURN (hb_deref (hb_forward (p)).has (v)) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 6eb1315..a47c8ca 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -211,4 +211,36 @@ 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 */