Added epicsAlgorithm.h header containing epicsMin, epicsMax & epicsSwap.

This commit is contained in:
Andrew Johnson
2001-03-27 16:53:22 +00:00
parent a8f3980097
commit a16fdfe45e
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// epicsAlgorithm.h
// Authors: Jeff Hill & Andrew Johnson
#ifndef __EPICS_ALGORITHM_H__
#define __EPICS_ALGORITHM_H__
template <class T>
inline const T& epicsMax (const T& a, const T& b)
{
return (a<b) ? b : a;
}
template <class T>
inline const T& epicsMin (const T& a, const T& b)
{
return (a<b) ? a : b;
}
template <class T>
inline void epicsSwap(T& a, T& b)
{
T temp = a;
a = b;
b = temp;
}
#endif // __EPICS_ALGORITHM_H__