From 1c7665bbc1268d6a4b27f7e62e4663f3079053d8 Mon Sep 17 00:00:00 2001 From: Daniel Stevens Date: Tue, 4 Mar 2025 22:06:03 -0700 Subject: [PATCH] Mark `scaleLinear` as `constexpr` --- NAS2D/Math/MathUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NAS2D/Math/MathUtils.h b/NAS2D/Math/MathUtils.h index bff9c22a..140356c1 100644 --- a/NAS2D/Math/MathUtils.h +++ b/NAS2D/Math/MathUtils.h @@ -46,7 +46,7 @@ namespace NAS2D * InputType and OutputType must support all arithmetic operators and all arithmetic operators between each other. */ template - OutputType scaleLinear(const InputType& value, const InputType& domainPoint1, const InputType& domainPoint2, const OutputType& rangePoint1, const OutputType& rangePoint2) + constexpr OutputType scaleLinear(const InputType& value, const InputType& domainPoint1, const InputType& domainPoint2, const OutputType& rangePoint1, const OutputType& rangePoint2) { return (value - domainPoint1) * (rangePoint2 - rangePoint1) / (domainPoint2 - domainPoint1) + rangePoint1; }