diff options
author | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-10-02 14:42:30 -0400 |
commit | 8aaf029ab6046eb8cbe600a548d176c1418bd99a (patch) | |
tree | d8a89392817379e3036c42eedebf33d4fb372dfd /zen/basic_math.h | |
parent | Merge branch '11.1' into 'master' (diff) | |
download | FreeFileSync-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.h | 9 |
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); } |