[algs] Add hb_min() and hb_max()

This commit is contained in:
Behdad Esfahbod 2019-04-03 16:06:34 -07:00
parent 7b863142ce
commit ecabdffc61
1 changed files with 11 additions and 0 deletions

View File

@ -98,6 +98,17 @@ static const struct
operator () (const Pair& pair) const { return pair.second; }
} hb_second HB_UNUSED;
static const struct
{
template <typename T, typename T2> T
operator () (const T& a, const T2& b) const { return a <= b ? a : b; }
} hb_min HB_UNUSED;
static const struct
{
template <typename T, typename T2> T
operator () (const T& a, const T2& b) const { return a >= b ? a : b; }
} hb_max HB_UNUSED;
/*
* Bithacks.