From 17df4c2b9616c29865b0d893cc797d4938a660a2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 24 Sep 2008 00:19:12 +0000 Subject: 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... --- src/util.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index b55ceee..efbfb26 100644 --- a/src/util.h +++ b/src/util.h @@ -27,18 +27,36 @@ namespace Bu b = tmp; } + template + const item &min( const item &a, const item &b ) + { + return a item &min( item &a, item &b ) { return a + const item &max( const item &a, const item &b ) + { + return a>b?a:b; + } + template item &max( item &a, item &b ) { return a>b?a:b; } + template + const item &mid( const item &a, const item &b, const item &c ) + { + return min( max( a, b ), c ); + } + template item &mid( item &a, item &b, item &c ) { -- cgit v1.2.3