From 076498028ff511afd88d93e7b0bf1d1a81093b3d Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 13 Nov 2018 06:58:56 -0500 Subject: 10.6 --- zen/basic_math.h | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'zen/basic_math.h') diff --git a/zen/basic_math.h b/zen/basic_math.h index 0d08f6a6..75f5d3b8 100755 --- a/zen/basic_math.h +++ b/zen/basic_math.h @@ -21,14 +21,8 @@ namespace numeric template T abs(T value); template auto dist(T a, T b); template int sign(T value); //returns one of {-1, 0, 1} -template T min(T a, T b, T c); -template T max(T a, T b, T c); template bool isNull(T value); -template void clamp(T& val, T minVal, T maxVal); //make sure minVal <= val && val <= maxVal -template T clampCpy(T val, T minVal, T maxVal); -//std::clamp() available with C++17 - template //precondition: range must be sorted! auto nearMatch(const T& val, InputIterator first, InputIterator last); @@ -106,51 +100,6 @@ int sign(T value) //returns one of {-1, 0, 1} return value < 0 ? -1 : (value > 0 ? 1 : 0); } - -template inline -T min(T a, T b, T c) //don't follow std::min's "const T&(const T&, const T&)" API -{ - if (a < b) - return a < c ? a : c; - else - return b < c ? b : c; - //return std::min(std::min(a, b), c); -} - - -template inline -T max(T a, T b, T c) -{ - if (a > b) - return a > c ? a : c; - else - return b > c ? b : c; - //return std::max(std::max(a, b), c); -} - - -template inline -T clampCpy(T val, T minVal, T maxVal) -{ - assert(minVal <= maxVal); - if (val < minVal) - return minVal; - else if (val > maxVal) - return maxVal; - return val; -} - -template inline -void clamp(T& val, T minVal, T maxVal) -{ - assert(minVal <= maxVal); - if (val < minVal) - val = minVal; - else if (val > maxVal) - val = maxVal; -} - - /* part of C++11 now! template inline -- cgit