forked from eden-emu/eden
		
	disable unary minus when the type is not signed
silent warning C4146 on msvc
This commit is contained in:
		
							parent
							
								
									161be512fd
								
							
						
					
					
						commit
						8de154893c
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -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); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 wwylele
						wwylele