From a16fdfe45effde3476c1c0f268be20cbe4feb7cb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 27 Mar 2001 16:53:22 +0000 Subject: [PATCH] Added epicsAlgorithm.h header containing epicsMin, epicsMax & epicsSwap. --- src/libCom/Makefile | 1 + src/libCom/cppStd/epicsAlgorithm.h | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/libCom/cppStd/epicsAlgorithm.h diff --git a/src/libCom/Makefile b/src/libCom/Makefile index e14642545..2017352fc 100644 --- a/src/libCom/Makefile +++ b/src/libCom/Makefile @@ -37,6 +37,7 @@ SRCS += cvtFast.c # From cppStd SRC_DIRS += $(LIBCOM)/cppStd +INC += epicsAlgorithm.h INC += epicsExcept.h INC += epicsList.h INC += epicsListBase.h diff --git a/src/libCom/cppStd/epicsAlgorithm.h b/src/libCom/cppStd/epicsAlgorithm.h new file mode 100644 index 000000000..1bedf1e1a --- /dev/null +++ b/src/libCom/cppStd/epicsAlgorithm.h @@ -0,0 +1,27 @@ +// epicsAlgorithm.h +// Authors: Jeff Hill & Andrew Johnson + +#ifndef __EPICS_ALGORITHM_H__ +#define __EPICS_ALGORITHM_H__ + +template +inline const T& epicsMax (const T& a, const T& b) +{ + return (a +inline const T& epicsMin (const T& a, const T& b) +{ + return (a +inline void epicsSwap(T& a, T& b) +{ + T temp = a; + a = b; + b = temp; +} + +#endif // __EPICS_ALGORITHM_H__