From: Behdad Esfahbod Date: Wed, 3 Apr 2019 23:06:34 +0000 (-0700) Subject: [algs] Add hb_min() and hb_max() X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ecabdffc61cb0b71424f4845aeda8cd0a6d25a29;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [algs] Add hb_min() and hb_max() --- diff --git a/src/hb-algs.hh b/src/hb-algs.hh index adf5c48..2765e1c 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -98,6 +98,17 @@ static const struct operator () (const Pair& pair) const { return pair.second; } } hb_second HB_UNUSED; +static const struct +{ + template T + operator () (const T& a, const T2& b) const { return a <= b ? a : b; } +} hb_min HB_UNUSED; +static const struct +{ + template T + operator () (const T& a, const T2& b) const { return a >= b ? a : b; } +} hb_max HB_UNUSED; + /* * Bithacks.