diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:52:54 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:52:54 +0200 |
commit | 782e3f33cf07e2b3210e9bee9607f34bf6dfc5df (patch) | |
tree | a5b07ff5345140520e7eaf4be4d3bb5f4b8f8c26 /zen/basic_math.h | |
parent | 6.9 (diff) | |
download | FreeFileSync-782e3f33cf07e2b3210e9bee9607f34bf6dfc5df.tar.gz FreeFileSync-782e3f33cf07e2b3210e9bee9607f34bf6dfc5df.tar.bz2 FreeFileSync-782e3f33cf07e2b3210e9bee9607f34bf6dfc5df.zip |
6.10
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r-- | zen/basic_math.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h index 56cfd923..69e861be 100644 --- a/zen/basic_math.h +++ b/zen/basic_math.h @@ -32,9 +32,9 @@ template <class T> const T& max(const T& a, const T& b, const T& c); template <class T> -void confine(T& val, const T& minVal, const T& maxVal); //make sure minVal <= val && val <= maxVal +void clamp(T& val, const T& minVal, const T& maxVal); //make sure minVal <= val && val <= maxVal template <class T> -T confineCpy(const T& val, const T& minVal, const T& maxVal); +T clampCpy(const T& val, const T& minVal, const T& maxVal); template <class T, class InputIterator> //precondition: range must be sorted! auto nearMatch(const T& val, InputIterator first, InputIterator last) -> typename std::iterator_traits<InputIterator>::value_type; @@ -134,7 +134,7 @@ const T& max(const T& a, const T& b, const T& c) template <class T> inline -T confineCpy(const T& val, const T& minVal, const T& maxVal) +T clampCpy(const T& val, const T& minVal, const T& maxVal) { assert(minVal <= maxVal); if (val < minVal) @@ -145,7 +145,7 @@ T confineCpy(const T& val, const T& minVal, const T& maxVal) } template <class T> inline -void confine(T& val, const T& minVal, const T& maxVal) //name trim, clamp? +void clamp(T& val, const T& minVal, const T& maxVal) { assert(minVal <= maxVal); if (val < minVal) |