diff --git a/maths.hpp b/maths.hpp index 9e8e9f35..475666ea 100644 --- a/maths.hpp +++ b/maths.hpp @@ -628,7 +628,10 @@ namespace util { // min/max clamping template constexpr - T + std::enable_if_t< + std::is_scalar_v && std::is_scalar_v && std::is_scalar_v, + std::common_type_t + > limit (const T val, const U lo, const V hi) { assert (lo <= hi);