mirror of
https://github.com/NoelFB/blah.git
synced 2026-11-10 00:35:14 +08:00
cleaned up Calc template functions
This commit is contained in:
1 parent
6f2cf82b8e
commit
5f9df4beee
2 files changed
+14
-8
No files matched your search
@@ -42,11 +42,17 @@ namespace Blah
|
||||
template<class T>
|
||||
T clamp(T value, T min, T max) { return value < min ? min : (value > max ? max : value); }
|
||||
|
||||
template<class T, class U>
|
||||
T min(T a, U b) { return (T)(a < b ? a : b); }
|
||||
template<class T>
|
||||
T min(T a, T b) { return (T)(a < b ? a : b); }
|
||||
|
||||
template<class T, class U>
|
||||
T max(T a, U b) { return (T)(a > b ? a : b); }
|
||||
template<class T, typename ... Args>
|
||||
T min(const T& a, const T& b, const Args&... args) { return Calc::min(a, Calc::min(b, args...)); }
|
||||
|
||||
template<class T>
|
||||
T max(T a, T b) { return (T)(a > b ? a : b); }
|
||||
|
||||
template<class T, typename ... Args>
|
||||
T max(const T& a, const T& b, const Args&... args) { return Calc::max(a, Calc::max(b, args...)); }
|
||||
|
||||
float round(float x);
|
||||
|
||||
|
||||
Reference in new issue
Block a user