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; }