EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
epicsAlgorithm.h File Reference

Contains a few templates out of the C++ standard header algorithm. More...

#include "epicsMath.h"
Include dependency graph for epicsAlgorithm.h:

Go to the source code of this file.

Functions

template<class T >
const T & epicsMin (const T &a, const T &b)
 
template<>
const float & epicsMin (const float &a, const float &b)
 
template<>
const double & epicsMin (const double &a, const double &b)
 
template<class T >
const T & epicsMax (const T &a, const T &b)
 
template<>
const float & epicsMax (const float &a, const float &b)
 
template<>
const double & epicsMax (const double &a, const double &b)
 
template<class T >
void epicsSwap (T &a, T &b)
 

Detailed Description

Author
Jeff Hill & Andrew Johnson
Deprecated:
Use std::min()/max()/swap() in new code

Definition in file epicsAlgorithm.h.

Function Documentation

template<class T >
const T& epicsMin ( const T &  a,
const T &  b 
)
inline

Returns the smaller of a or b compared using a<b.

Definition at line 30 of file epicsAlgorithm.h.

template<>
const float& epicsMin ( const float &  a,
const float &  b 
)
inline

Returns the smaller of a or b compared using a<b.

Note
If b is a NaN the above template returns a, but should return NaN. These specializations ensure that epicsMin(x,NaN) == NaN

Definition at line 42 of file epicsAlgorithm.h.

template<>
const double& epicsMin ( const double &  a,
const double &  b 
)
inline

Returns the smaller of a or b compared using a<b.

Note
If b is a NaN the above template returns a, but should return NaN. These specializations ensure that epicsMin(x,NaN) == NaN

Definition at line 54 of file epicsAlgorithm.h.

template<class T >
const T& epicsMax ( const T &  a,
const T &  b 
)
inline

Returns the larger of a or b compared using a<b.

Definition at line 64 of file epicsAlgorithm.h.

template<>
const float& epicsMax ( const float &  a,
const float &  b 
)
inline

Returns the larger of a or b compared using a<b.

Note
If b is a NaN the above template returns a, but should return NaN. These specializations ensure that epicsMax(x,NaN) == NaN

Definition at line 76 of file epicsAlgorithm.h.

template<>
const double& epicsMax ( const double &  a,
const double &  b 
)
inline

Returns the larger of a or b compared using a<b.

Note
If b is a NaN the above template returns a, but should return NaN. These specializations ensure that epicsMax(x,NaN) == NaN

Definition at line 88 of file epicsAlgorithm.h.

template<class T >
void epicsSwap ( T &  a,
T &  b 
)
inline

Swaps the values of a and b.

Note
The data type must support both copy-construction and assignment.

Definition at line 100 of file epicsAlgorithm.h.