]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/compare.hh
release: 0.0.3
[lilypond.git] / flower / compare.hh
index 05b6e89e41d8a0e9143eed417905b11fcba2691f..47c7101c87cb9b65029b8dd4874194a836e4375c 100644 (file)
@@ -2,21 +2,24 @@
 #define COMPARE_HH
 
 /// handy notations for a signed comparison
-#define instantiate_compare(type, function)                            \
-inline bool operator>(type t1, type t2) { return function(t1, t2) > 0; }       \
- inline bool operator>=(type t1, type t2) { return function(t1, t2) >= 0; }    \
- inline bool operator==(type t1, type t2) { return function(t1, t2) == 0; }    \
- inline bool operator<=(type t1, type t2) { return function(t1, t2) <= 0; }    \
- inline bool operator<(type t1, type t2) { return function(t1, t2) < 0; } \
- inline type MAX(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
- inline type MIN(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
+#define template_instantiate_compare(type, function, prefix)                           \
+prefix inline bool operator>(type t1, type t2) { return function(t1, t2) > 0; }        \
+prefix inline bool operator>=(type t1, type t2) { return function(t1, t2) >= 0; }      \
+prefix inline bool operator==(type t1, type t2) { return function(t1, t2) == 0; }      \
+prefix inline bool operator<=(type t1, type t2) { return function(t1, t2) <= 0; }      \
+prefix inline bool operator<(type t1, type t2) { return function(t1, t2) < 0; } \
+prefix inline type MAX(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
+prefix inline type MIN(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
   \
-  bool operator<(type t1, type t2) /* stupid fix to allow ; */
+prefix  bool operator<(type t1, type t2) /* stupid fix to allow ; */
      /**
     make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
     Please fill a & in the type argument if necessary.    
     */
 
+
+    
+#define instantiate_compare(type, func) template_instantiate_compare(type,func, )