]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/direction.hh
Implement minmax()
[lilypond.git] / flower / include / direction.hh
index 3cdaf8d9addd69f82d763b8042aa849e8d093d0b..befd0aa2ac207e4f2a18208a45bbf0ddb611047b 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -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);