diff --git a/src/hb-algs.hh b/src/hb-algs.hh index 112655732..85da97b1f 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -215,7 +215,9 @@ struct template auto impl (Pred&& p, Val &&v, hb_priority<1>) const HB_AUTO_RETURN - (hb_deref (hb_forward (p)).has (hb_forward (v))) + ( + hb_deref (hb_forward (p)).has (hb_forward (v)) + ) template auto impl (Pred&& p, Val &&v, hb_priority<0>) const HB_AUTO_RETURN @@ -269,7 +271,9 @@ struct template auto impl (Proj&& f, Val &&v, hb_priority<2>) const HB_AUTO_RETURN - (hb_deref (hb_forward (f)).get (hb_forward (v))) + ( + hb_deref (hb_forward (f)).get (hb_forward (v)) + ) template auto impl (Proj&& f, Val &&v, hb_priority<1>) const HB_AUTO_RETURN @@ -296,6 +300,40 @@ struct } HB_FUNCOBJ (hb_get); +struct +{ + private: + + template auto + impl (T1&& v1, T2 &&v2, hb_priority<2>) const HB_AUTO_RETURN + ( + hb_forward (v2). cmp (hb_forward (v1)) == 0 + ) + + template auto + impl (T1&& v1, T2 &&v2, hb_priority<1>) const HB_AUTO_RETURN + ( + hb_forward (v1). cmp (hb_forward (v2)) == 0 + ) + + template auto + impl (T1&& v1, T2 &&v2, hb_priority<0>) const HB_AUTO_RETURN + ( + hb_forward (v1) == hb_forward (v2) + ) + + public: + + template auto + operator () (T1&& v1, T2 &&v2) const HB_AUTO_RETURN + ( + impl (hb_forward (v1), + hb_forward (v2), + hb_prioritize) + ) +} +HB_FUNCOBJ (hb_equal); + template struct hb_pair_t diff --git a/src/hb-array.hh b/src/hb-array.hh index 568cd02c7..576b1e094 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -142,7 +142,7 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> bool lfind (const T &x, unsigned *pos = nullptr) const { for (unsigned i = 0; i < length; ++i) - if (!this->arrayZ[i].cmp (x)) + if (hb_equal (this->arrayZ[i], x)) { if (pos) *pos = i;