summaryrefslogtreecommitdiff
path: root/zen/basic_math.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-10-02 14:42:30 -0400
committerB Stack <bgstack15@gmail.com>2020-10-02 14:42:30 -0400
commit8aaf029ab6046eb8cbe600a548d176c1418bd99a (patch)
treed8a89392817379e3036c42eedebf33d4fb372dfd /zen/basic_math.h
parentMerge branch '11.1' into 'master' (diff)
downloadFreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.gz
FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.bz2
FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.zip
add upstream 11.2
Diffstat (limited to 'zen/basic_math.h')
-rw-r--r--zen/basic_math.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h
index 0e30c276..26fb9e58 100644
--- a/zen/basic_math.h
+++ b/zen/basic_math.h
@@ -183,18 +183,15 @@ auto integerDivideRoundUp(N numerator, D denominator)
namespace
{
template <size_t N, class T> struct PowerImpl;
-/*
- template <size_t N, class T> -> let's use non-recursive specializations to help the compiler
- struct PowerImpl { static T result(const T& value) { return PowerImpl<N - 1, T>::result(value) * value; } };
-*/
+//let's use non-recursive specializations to help the compiler
template <class T> struct PowerImpl<2, T> { static T result(T value) { return value * value; } };
template <class T> struct PowerImpl<3, T> { static T result(T value) { return value * value * value; } };
}
-template <size_t n, class T> inline
+template <size_t N, class T> inline
T power(T value)
{
- return PowerImpl<n, T>::result(value);
+ return PowerImpl<N, T>::result(value);
}
bgstack15