diff --git a/glm/detail/func_common.inl b/glm/detail/func_common.inl index 65304a45..a788eb4c 100644 --- a/glm/detail/func_common.inl +++ b/glm/detail/func_common.inl @@ -70,6 +70,8 @@ namespace detail { GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, vecType const & a) { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); + return vecType(vecType(x) + a * vecType(y - x)); } }; @@ -91,6 +93,8 @@ namespace detail { GLM_FUNC_QUALIFIER static vecType call(vecType const & x, vecType const & y, U const & a) { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); + return vecType(vecType(x) + a * vecType(y - x)); } }; @@ -109,6 +113,8 @@ namespace detail { GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); + return static_cast(static_cast(x) + a * static_cast(y - x)); } };