summaryrefslogtreecommitdiff
path: root/core/src/Utils/Math.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-31 12:27:58 -0700
committerrtk0c <[email protected]>2021-05-31 12:27:58 -0700
commit8157678eba97d7de5c53b424a9866d327392bbd9 (patch)
tree26348a926040ccfc91f74cdfe49f7153db271f87 /core/src/Utils/Math.hpp
parenteef2514908cdec3ec02888b7467cc877d33c1ceb (diff)
Fix standard incompetence found by MSVC
- requires-expression still not working, because they aren't supported yet outside of a concept
Diffstat (limited to 'core/src/Utils/Math.hpp')
-rw-r--r--core/src/Utils/Math.hpp11
1 files changed, 11 insertions, 0 deletions
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 <class T>
+constexpr T Abs(T t)
+{
+ return t < 0 ? -t : t;
+}
+
+} // namespace Math