diff options
author | bunnei <bunneidev@gmail.com> | 2015-11-18 11:49:56 -0500 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-11-18 11:49:56 -0500 |
commit | f971aceac39b643765c45dfb25827e7ea689bb67 (patch) | |
tree | 849e7919afb301eaf56d202083db79a31c139a43 | |
parent | 161be512fd63241554a9199b2da2e60bde7668ae (diff) | |
parent | 1f89d5d184ab3a034c1501ad3e9844d787cbae41 (diff) |
Merge pull request #1239 from wwylele/silent-vec-warning
Common: silence Vec warnings on msvc
-rw-r--r-- | src/common/vector_math.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/vector_math.h b/src/common/vector_math.h index 4928c9bf2d..02688e35e0 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<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::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<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::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<typename Q = T,class = typename std::enable_if<std::is_signed<Q>::value>::type> Vec4<decltype(-T{})> operator -() const { return MakeVec(-x,-y,-z,-w); |