From 2db25f5468c787100e481726415479880e31f675 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 30 Mar 2021 22:38:22 +0200 Subject: [PATCH] Fix the boolean version of normalizeInput --- src/sfizz/Defaults.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/sfizz/Defaults.h b/src/sfizz/Defaults.h index 8bb62ee3..5edbdbbe 100644 --- a/src/sfizz/Defaults.h +++ b/src/sfizz/Defaults.h @@ -68,6 +68,10 @@ struct OpcodeSpec Range bounds; int flags; + template + using IsNormalizable = std::integral_constant< + bool, std::is_arithmetic::value && !std::is_same::value>; + /** * @brief Normalizes an input as needed for the spec * @@ -76,7 +80,7 @@ struct OpcodeSpec * @return U */ template - typename std::enable_if::value, U>::type normalizeInput(U input) const + typename std::enable_if::value, U>::type normalizeInput(U input) const { constexpr int needsOperation { kNormalizePercent | @@ -107,13 +111,7 @@ struct OpcodeSpec * @return U */ template - typename std::enable_if::value, U>::type normalizeInput(U input) const - { - return input; - } - - template<> - typename bool normalizeInput(bool input) const + typename std::enable_if::value, U>::type normalizeInput(U input) const { return input; }