From 33b940562e5ef6b5c3327abf4de02209fafd44d8 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 23 Apr 1997 17:11:50 +0000 Subject: [PATCH] min() => tsMin() also max --- src/cxxTemplates/Makefile.Host | 2 +- src/cxxTemplates/minmax.h | 22 ---------------------- src/cxxTemplates/test/minmaxTest.cc | 2 +- src/cxxTemplates/tsMinMax.h | 18 ++++++++++++++++++ src/libCom/cxxTemplates/test/minmaxTest.cc | 2 +- src/libCom/cxxTemplates/tsMinMax.h | 18 ++++++++++++++++++ 6 files changed, 39 insertions(+), 25 deletions(-) delete mode 100644 src/cxxTemplates/minmax.h create mode 100644 src/cxxTemplates/tsMinMax.h create mode 100644 src/libCom/cxxTemplates/tsMinMax.h diff --git a/src/cxxTemplates/Makefile.Host b/src/cxxTemplates/Makefile.Host index dcd95d5b3..aec04a573 100644 --- a/src/cxxTemplates/Makefile.Host +++ b/src/cxxTemplates/Makefile.Host @@ -6,7 +6,7 @@ INC += resourceLib.cc INC += tsDLList.h INC += tsSLList.h INC += tsBTree.h -INC += minmax.h +INC += tsMinMax.h include $(TOP)/config/RULES.Host diff --git a/src/cxxTemplates/minmax.h b/src/cxxTemplates/minmax.h deleted file mode 100644 index 772416607..000000000 --- a/src/cxxTemplates/minmax.h +++ /dev/null @@ -1,22 +0,0 @@ - -// -// simple inline template functions to replace the min() and max() -// macros -// - -// -// ??? g++ 2.7.2 -Winline is unable to in line these tiny functions ??? -// - -template -inline const T &max(const T &a, const T &b) -{ - return (a>b) ? a : b; -} - -template -inline const T &min(const T &a, const T &b) -{ - return (a -#include "minmax.h" +#include "tsMinMax.h" main () { diff --git a/src/cxxTemplates/tsMinMax.h b/src/cxxTemplates/tsMinMax.h new file mode 100644 index 000000000..1cab10dee --- /dev/null +++ b/src/cxxTemplates/tsMinMax.h @@ -0,0 +1,18 @@ + +// +// simple type safe inline template functions to replace +// the min() and max() macros +// + +template +inline const T &tsMax(const T &a, const T &b) +{ + return (a>b) ? a : b; +} + +template +inline const T &tsMin(const T &a, const T &b) +{ + return (a -#include "minmax.h" +#include "tsMinMax.h" main () { diff --git a/src/libCom/cxxTemplates/tsMinMax.h b/src/libCom/cxxTemplates/tsMinMax.h new file mode 100644 index 000000000..1cab10dee --- /dev/null +++ b/src/libCom/cxxTemplates/tsMinMax.h @@ -0,0 +1,18 @@ + +// +// simple type safe inline template functions to replace +// the min() and max() macros +// + +template +inline const T &tsMax(const T &a, const T &b) +{ + return (a>b) ? a : b; +} + +template +inline const T &tsMin(const T &a, const T &b) +{ + return (a