diff options
author | rtk0c <[email protected]> | 2021-05-31 12:27:58 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-05-31 12:27:58 -0700 |
commit | 8157678eba97d7de5c53b424a9866d327392bbd9 (patch) | |
tree | 26348a926040ccfc91f74cdfe49f7153db271f87 /core/src/Utils/Math.hpp | |
parent | eef2514908cdec3ec02888b7467cc877d33c1ceb (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.hpp | 11 |
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 |