summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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..02688e35e 100644
--- a/src/common/vector_math.h
+++ b/src/common/vector_math.h
@@ -32,6 +32,7 @@
32#pragma once 32#pragma once
33 33
34#include <cmath> 34#include <cmath>
35#include <type_traits>
35 36
36namespace Math { 37namespace Math {
37 38
@@ -90,6 +91,7 @@ public:
90 { 91 {
91 x-=other.x; y-=other.y; 92 x-=other.x; y-=other.y;
92 } 93 }
94 template<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::value>::type>
93 Vec2<decltype(-T{})> operator -() const 95 Vec2<decltype(-T{})> operator -() const
94 { 96 {
95 return MakeVec(-x,-y); 97 return MakeVec(-x,-y);
@@ -220,6 +222,7 @@ public:
220 { 222 {
221 x-=other.x; y-=other.y; z-=other.z; 223 x-=other.x; y-=other.y; z-=other.z;
222 } 224 }
225 template<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::value>::type>
223 Vec3<decltype(-T{})> operator -() const 226 Vec3<decltype(-T{})> operator -() const
224 { 227 {
225 return MakeVec(-x,-y,-z); 228 return MakeVec(-x,-y,-z);
@@ -390,6 +393,7 @@ public:
390 { 393 {
391 x-=other.x; y-=other.y; z-=other.z; w-=other.w; 394 x-=other.x; y-=other.y; z-=other.z; w-=other.w;
392 } 395 }
396 template<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::value>::type>
393 Vec4<decltype(-T{})> operator -() const 397 Vec4<decltype(-T{})> operator -() const
394 { 398 {
395 return MakeVec(-x,-y,-z,-w); 399 return MakeVec(-x,-y,-z,-w);