projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b86314
)
[algs] Add hb_min() and hb_max()
author
Behdad Esfahbod
<behdad@behdad.org>
Wed, 3 Apr 2019 23:06:34 +0000
(16:06 -0700)
committer
Behdad Esfahbod
<behdad@behdad.org>
Wed, 3 Apr 2019 23:06:34 +0000
(16:06 -0700)
src/hb-algs.hh
patch
|
blob
|
history
diff --git
a/src/hb-algs.hh
b/src/hb-algs.hh
index
adf5c48
..
2765e1c
100644
(file)
--- 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 <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.