diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 00:19:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-09-24 00:19:12 +0000 |
commit | 17df4c2b9616c29865b0d893cc797d4938a660a2 (patch) | |
tree | d31d62c5694279747909bbab2b8be93f01a7fb7b /src/util.h | |
parent | 5230927c4f087cf2dcaac4fb9ed133c1ff3e2269 (diff) | |
download | libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.gz libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.bz2 libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.tar.xz libbu++-17df4c2b9616c29865b0d893cc797d4938a660a2.zip |
Wholly crap. Added the Fifo, fixed a bunch of bugs, made things more standard,
now I have a huge list of new functions to add. Also, we discovered that if
we add -W it produces more warnings, warnings about things that we'd like to
know about. I have a lot of work to go fixing that...
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -28,18 +28,36 @@ namespace Bu | |||
28 | } | 28 | } |
29 | 29 | ||
30 | template<typename item> | 30 | template<typename item> |
31 | const item &min( const item &a, const item &b ) | ||
32 | { | ||
33 | return a<b?a:b; | ||
34 | } | ||
35 | |||
36 | template<typename item> | ||
31 | item &min( item &a, item &b ) | 37 | item &min( item &a, item &b ) |
32 | { | 38 | { |
33 | return a<b?a:b; | 39 | return a<b?a:b; |
34 | } | 40 | } |
35 | 41 | ||
36 | template<typename item> | 42 | template<typename item> |
43 | const item &max( const item &a, const item &b ) | ||
44 | { | ||
45 | return a>b?a:b; | ||
46 | } | ||
47 | |||
48 | template<typename item> | ||
37 | item &max( item &a, item &b ) | 49 | item &max( item &a, item &b ) |
38 | { | 50 | { |
39 | return a>b?a:b; | 51 | return a>b?a:b; |
40 | } | 52 | } |
41 | 53 | ||
42 | template<typename item> | 54 | template<typename item> |
55 | const item &mid( const item &a, const item &b, const item &c ) | ||
56 | { | ||
57 | return min( max( a, b ), c ); | ||
58 | } | ||
59 | |||
60 | template<typename item> | ||
43 | item &mid( item &a, item &b, item &c ) | 61 | item &mid( item &a, item &b, item &c ) |
44 | { | 62 | { |
45 | return min( max( a, b ), c ); | 63 | return min( max( a, b ), c ); |