提交 ecabdffc 编写于 作者: B Behdad Esfahbod

[algs] Add hb_min() and hb_max()

上级 7b863142
...@@ -98,6 +98,17 @@ static const struct ...@@ -98,6 +98,17 @@ static const struct
operator () (const Pair& pair) const { return pair.second; } operator () (const Pair& pair) const { return pair.second; }
} hb_second HB_UNUSED; } 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. * Bithacks.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册