mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 20:56:39 +00:00 
			
		
		
		
	added comparison operators for Ptr class
This commit is contained in:
		
							parent
							
								
									77a0215d53
								
							
						
					
					
						commit
						5d40055b44
					
				
					 1 changed files with 30 additions and 0 deletions
				
			
		|  | @ -121,6 +121,36 @@ namespace MWWorld | |||
|                 return *data.getCreatureStats(); | ||||
|             }             | ||||
|     }; | ||||
|      | ||||
|     inline bool operator== (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return left.mRefData==right.mRefData; | ||||
|     } | ||||
|      | ||||
|     inline bool operator!= (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return !(left==right); | ||||
|     } | ||||
| 
 | ||||
|     inline bool operator< (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return left.mRefData<right.mRefData; | ||||
|     } | ||||
| 
 | ||||
|     inline bool operator>= (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return !(left<right); | ||||
|     } | ||||
| 
 | ||||
|     inline bool operator> (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return right<left; | ||||
|     } | ||||
| 
 | ||||
|     inline bool operator<= (const Ptr& left, const Ptr& right) | ||||
|     { | ||||
|         return !(left>right); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue