]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/direction.hh
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / flower / include / direction.hh
index f3b31e3811a7c5245c294cbd72322b9dc3cd184d..0d36c0f7c7cca5ff25fb0a41f6917f52e1d01a83 100644 (file)
@@ -20,6 +20,7 @@
 #ifndef DIRECTION_HH
 #define DIRECTION_HH
 
+#include <algorithm>
 #include "axis.hh"
 
 enum Direction
@@ -49,26 +50,9 @@ enum Direction
 };
 
 inline Direction
-other_dir (Direction const d)
+operator - (Direction d)
 {
-  return (Direction) (-d);
-}
-
-inline Direction
-operator - (Direction const d)
-{
-  return other_dir (d);
-}
-
-// to be deleted soon (after coping with issues 2491 and 2493
-inline Direction
-flip (Direction *i)
-{
-  if (*i == (Direction)1)
-    *i = (Direction) - 1;
-  else if (*i == (Direction) - 1)
-    *i = (Direction)1;
-  return *i;
+  return Direction (- static_cast<int> (d)); // cast avoids recursion
 }
 
 #define UP_and_DOWN(d) \
@@ -92,6 +76,4 @@ template<class T> T minmax (Direction d, T a, T b)
     return min (a, b);
 }
 
-// String direction_string (Direction, Axis);
-
 #endif // DIRECTION_HH