summaryrefslogtreecommitdiff
path: root/zen/basic_math.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2016-03-16 21:31:24 +0100
committerDaniel Wilhelm <daniel@wili.li>2016-03-16 21:31:24 +0100
commit89621addb4a7c87d2e3f3e7462e3c690cf71de71 (patch)
tree008b5dea7624ee1eeb57ff82c45fdf1afcab3b08 /zen/basic_math.h
parent7.5 (diff)
downloadFreeFileSync-89621addb4a7c87d2e3f3e7462e3c690cf71de71.tar.gz
FreeFileSync-89621addb4a7c87d2e3f3e7462e3c690cf71de71.tar.bz2
FreeFileSync-89621addb4a7c87d2e3f3e7462e3c690cf71de71.zip
7.6
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r--zen/basic_math.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h
index 14fcae9c..8b745caf 100644
--- a/zen/basic_math.h
+++ b/zen/basic_math.h
@@ -4,8 +4,8 @@
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// **************************************************************************
-#ifndef BASIC_MATH_HEADER_34726398432
-#define BASIC_MATH_HEADER_34726398432
+#ifndef BASIC_MATH_H_3472639843265675
+#define BASIC_MATH_H_3472639843265675
#include <algorithm>
#include <iterator>
@@ -14,6 +14,7 @@
#include <functional>
#include <cassert>
+
namespace numeric
{
template <class T>
@@ -26,10 +27,10 @@ template <class T>
int sign(T value); //returns -1/0/1
template <class T>
-const T& min(const T& a, const T& b, const T& c);
+T min(T a, T b, T c);
template <class T>
-const T& max(const T& a, const T& b, const T& c);
+T max(T a, T b, T c);
template <class T>
void clamp(T& val, const T& minVal, const T& maxVal); //make sure minVal <= val && val <= maxVal
@@ -114,14 +115,14 @@ int sign(T value) //returns -1/0/1
template <class T> inline
-const T& min(const T& a, const T& b, const T& c)
+T min(T a, T b, T c) //don't follow std::min's "const T&(const T&, const T&)" API
{
return std::min(std::min(a, b), c);
}
template <class T> inline
-const T& max(const T& a, const T& b, const T& c)
+T max(T a, T b, T c)
{
return std::max(std::max(a, b), c);
}
@@ -396,4 +397,4 @@ double norm2(InputIterator first, InputIterator last)
}
}
-#endif //BASIC_MATH_HEADER_34726398432
+#endif //BASIC_MATH_H_3472639843265675
bgstack15