diff options
Diffstat (limited to '')
-rw-r--r-- | src/util.h | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -35,6 +35,46 @@ namespace Bu | |||
35 | { | 35 | { |
36 | return min( max( a, b ), c ); | 36 | return min( max( a, b ), c ); |
37 | } | 37 | } |
38 | |||
39 | // | ||
40 | // Basic comparison functors | ||
41 | // | ||
42 | template<typename item> | ||
43 | struct __basicLTCmp | ||
44 | { | ||
45 | bool operator()( const item &a, const item &b ) | ||
46 | { | ||
47 | return a < b; | ||
48 | } | ||
49 | }; | ||
50 | |||
51 | template<typename item> | ||
52 | struct __basicGTCmp | ||
53 | { | ||
54 | bool operator()( const item &a, const item &b ) | ||
55 | { | ||
56 | return a > b; | ||
57 | } | ||
58 | }; | ||
59 | |||
60 | template<typename item> | ||
61 | struct __basicPtrLTCmp | ||
62 | { | ||
63 | bool operator()( const item &a, const item &b ) | ||
64 | { | ||
65 | return *a < *b; | ||
66 | } | ||
67 | }; | ||
68 | |||
69 | template<typename item> | ||
70 | struct __basicPtrGTCmp | ||
71 | { | ||
72 | bool operator()( const item &a, const item &b ) | ||
73 | { | ||
74 | return *a > *b; | ||
75 | } | ||
76 | }; | ||
77 | |||
38 | }; | 78 | }; |
39 | 79 | ||
40 | #endif | 80 | #endif |