From 8157678eba97d7de5c53b424a9866d327392bbd9 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Mon, 31 May 2021 12:27:58 -0700 Subject: Fix standard incompetence found by MSVC - requires-expression still not working, because they aren't supported yet outside of a concept --- core/src/Utils/Math.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core/src/Utils/Math.hpp (limited to 'core/src/Utils/Math.hpp') diff --git a/core/src/Utils/Math.hpp b/core/src/Utils/Math.hpp new file mode 100644 index 0000000..2d0c0cd --- /dev/null +++ b/core/src/Utils/Math.hpp @@ -0,0 +1,11 @@ +#pragma once + +namespace MathUtils { + +template +constexpr T Abs(T t) +{ + return t < 0 ? -t : t; +} + +} // namespace Math -- cgit v1.2.3-70-g09d2