diff options
author | B Stack <bgstack15@gmail.com> | 2020-10-03 01:04:14 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-10-03 01:04:14 +0000 |
commit | 0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c (patch) | |
tree | d8a89392817379e3036c42eedebf33d4fb372dfd /zen/basic_math.h | |
parent | Merge branch '11.1' into 'master' (diff) | |
parent | add upstream 11.2 (diff) | |
download | FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.gz FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.tar.bz2 FreeFileSync-0576c1a2ab5ff534348c879ea03bb9c9d9f7ac4c.zip |
Merge branch '11.2' into 'master'11.2
add upstream 11.2
See merge request opensource-tracking/FreeFileSync!26
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); } |