]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Potentially fix compile with clang. The fix may be dangerous. divVerent/clang-fixes
authorRudolf Polzer <divverent@xonotic.org>
Sun, 9 Feb 2014 17:59:33 +0000 (18:59 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 9 Feb 2014 17:59:33 +0000 (18:59 +0100)
I changed how Reference<> types compare - they previously compared by
value (which is not even supported in clang), now compare by reference.

If this breaks anything, I'll rather undo this and instead make the
types used as Reference<> support operator< to compare by value. But I
think comparison by reference is actually wanted here.

libs/generic/reference.h

index df5a05a8f3c3ece6985742bcd12ae1514f369eb6..141f14f42a144cf672211d8976a26ec63ff59dcf 100644 (file)
@@ -49,11 +49,11 @@ Type* get_pointer() const {
 
 template<typename Type>
 bool operator<( const Reference<Type>& self, const Reference<Type>& other ){
-       return self.get() < other.get();
+       return self.get_pointer() < other.get_pointer();
 }
 template<typename Type>
 bool operator==( const Reference<Type>& self, const Reference<Type>& other ){
-       return self.get() == other.get();
+       return self.get_pointer() == other.get_pointer();
 }
 
 /// \brief construct a reference to a mutable object.