diff options
Diffstat (limited to 'Tools/NoiseSpeedTest')
-rw-r--r-- | Tools/NoiseSpeedTest/Globals.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tools/NoiseSpeedTest/Globals.h b/Tools/NoiseSpeedTest/Globals.h index 22f39575e..f0400f853 100644 --- a/Tools/NoiseSpeedTest/Globals.h +++ b/Tools/NoiseSpeedTest/Globals.h @@ -230,3 +230,10 @@ T Clamp(T a_Value, T a_Min, T a_Max) { return (a_Value < a_Min) ? a_Min : ((a_Value > a_Max) ? a_Max : a_Value); } + +template <typename T> +auto ToUnsigned(T a_Val) +{ + ASSERT(a_Val >= 0); + return static_cast<std::make_unsigned_t<T>>(a_Val); +} |