]> git.donarmstrong.com Git - lilypond.git/blob - flower/compare.hh
release: 0.0.1
[lilypond.git] / flower / compare.hh
1 #ifndef COMPARE_HH
2 #define COMPARE_HH
3
4 /// handy notations for a signed comparison
5 #define instantiate_compare(type, function)                             \
6 inline bool operator>(type t1, type t2) { return function(t1, t2) > 0; }        \
7  inline bool operator>=(type t1, type t2) { return function(t1, t2) >= 0; }     \
8  inline bool operator==(type t1, type t2) { return function(t1, t2) == 0; }     \
9  inline bool operator<=(type t1, type t2) { return function(t1, t2) <= 0; }     \
10  inline bool operator<(type t1, type t2) { return function(t1, t2) < 0; } \
11  inline type MAX(type t1, type t2) {  return (t1 > t2 )? t1 : t2; }\
12  inline type MIN(type t1, type t2) {  return (t1 < t2 )? t1 : t2; }\
13   \
14   bool operator<(type t1, type t2) /* stupid fix to allow ; */
15      /**
16     make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
17     Please fill a & in the type argument if necessary.    
18     */
19
20      
21
22      
23 #endif
24