diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 691edcd48..523629aab 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -120,9 +120,9 @@ struct HB_FUNCOBJ (hb_invoke); template -struct hb_binder_t +struct hb_partial_t { - hb_binder_t (Appl a, V v) : a (a), v (v) {} + hb_partial_t (Appl a, V v) : a (a), v (v) {} static_assert (Pos > 0, ""); @@ -155,13 +155,13 @@ struct hb_binder_t hb_reference_wrapper a; V v; }; -template -auto hb_bind (Appl&& a, V&& v) HB_AUTO_RETURN -(( hb_binder_t (a, v) )) +template +auto hb_partial (Appl&& a, V&& v) HB_AUTO_RETURN +(( hb_partial_t (a, v) )) #define HB_PARTIALIZE(Pos) \ template \ - auto operator () (_T&& _v) const HB_AUTO_RETURN (hb_bind (this, hb_forward<_T> (_v))) \ + auto operator () (_T&& _v) const HB_AUTO_RETURN (hb_partial (this, hb_forward<_T> (_v))) \ static_assert (true, "") diff --git a/src/test-algs.cc b/src/test-algs.cc index 02b3d3a0a..333a89242 100644 --- a/src/test-algs.cc +++ b/src/test-algs.cc @@ -77,10 +77,10 @@ main (int argc, char **argv) xp = hb_pair_t (nullptr, 1); xp = hb_pair_t (nullptr, 1); - assert (3 == hb_bind<1> (hb_min, 3) (4)); - assert (3 == hb_bind<2> (hb_min, 4) (3)); + assert (3 == hb_partial (hb_min, 3) (4)); + assert (3 == hb_partial<1> (hb_min, 4) (3)); - auto M0 = hb_bind<2> (hb_max, 0); + auto M0 = hb_partial<2> (hb_max, 0); assert (M0 (-2) == 0); assert (M0 (+2) == 2);