]> git.donarmstrong.com Git - lilypond.git/commitdiff
Implement minmax()
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Mon, 7 Feb 2011 15:16:41 +0000 (13:16 -0200)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Wed, 9 Feb 2011 03:48:50 +0000 (01:48 -0200)
flower/include/direction.hh

index 0ba482fe2c580ff9ac73926879c075484439decc..befd0aa2ac207e4f2a18208a45bbf0ddb611047b 100644 (file)
@@ -75,7 +75,13 @@ flip (Direction *i)
    if d > 0: the max operator
    if d < 0: the min operator
 */
-template<class T> T minmax (Direction d, T, T);
+template<class T> T minmax (Direction d, T a, T b)
+{
+  if (d == UP)
+    return max (a, b);
+  else
+    return min (a, b);
+}
 
 // String direction_string (Direction, Axis);