summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2015-11-12 16:19:02 +0100
committerwwylele <wwylele@gmail.com>2015-11-12 19:39:28 +0100
commit8de154893c9bc1b31f29840715551a75eb76adb2 (patch)
tree333a3118678d33880151f2e167caac3a4dadb83a /src
parentMerge pull request #1238 from citra-emu/neobrain-rtti (diff)
downloadyuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar.gz
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar.bz2
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar.lz
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar.xz
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.tar.zst
yuzu-8de154893c9bc1b31f29840715551a75eb76adb2.zip
Diffstat (limited to 'src')
-rw-r--r--src/common/vector_math.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h
index 4928c9bf2..816ad4e33 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -32,6 +32,7 @@
#pragma once
#include <cmath>
+#include <type_traits>
namespace Math {
@@ -90,6 +91,7 @@ public:
{
x-=other.x; y-=other.y;
}
+ template<class = typename std::enable_if<std::is_signed<T>::value>::type>
Vec2<decltype(-T{})> operator -() const
{
return MakeVec(-x,-y);
@@ -220,6 +222,7 @@ public:
{
x-=other.x; y-=other.y; z-=other.z;
}
+ template<class = typename std::enable_if<std::is_signed<T>::value>::type>
Vec3<decltype(-T{})> operator -() const
{
return MakeVec(-x,-y,-z);
@@ -390,6 +393,7 @@ public:
{
x-=other.x; y-=other.y; z-=other.z; w-=other.w;
}
+ template<class = typename std::enable_if<std::is_signed<T>::value>::type>
Vec4<decltype(-T{})> operator -() const
{
return MakeVec(-x,-y,-z,-w);