min() => tsMin() also max

This commit is contained in:
Jeff Hill
1997-04-23 17:11:50 +00:00
parent 08f2298215
commit 33b940562e
6 changed files with 39 additions and 25 deletions

View File

@@ -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

View File

@@ -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 <class T>
inline const T &max(const T &a, const T &b)
{
return (a>b) ? a : b;
}
template <class T>
inline const T &min(const T &a, const T &b)
{
return (a<b) ? a : b;
}

View File

@@ -1,7 +1,7 @@
#include <assert.h>
#include "minmax.h"
#include "tsMinMax.h"
main ()
{

View File

@@ -0,0 +1,18 @@
//
// simple type safe inline template functions to replace
// the min() and max() macros
//
template <class T>
inline const T &tsMax(const T &a, const T &b)
{
return (a>b) ? a : b;
}
template <class T>
inline const T &tsMin(const T &a, const T &b)
{
return (a<b) ? a : b;
}

View File

@@ -1,7 +1,7 @@
#include <assert.h>
#include "minmax.h"
#include "tsMinMax.h"
main ()
{

View File

@@ -0,0 +1,18 @@
//
// simple type safe inline template functions to replace
// the min() and max() macros
//
template <class T>
inline const T &tsMax(const T &a, const T &b)
{
return (a>b) ? a : b;
}
template <class T>
inline const T &tsMin(const T &a, const T &b)
{
return (a<b) ? a : b;
}