From 439f74c5406f8f1bb970065f1efe2dc007a7808f Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Fri, 9 Sep 2022 15:29:17 +0200 Subject: [PATCH] Fix comparison operators on object reference types --- Source/Engine/Content/AssetReference.h | 8 ++++---- Source/Engine/Content/SoftAssetReference.h | 8 ++++---- Source/Engine/Content/WeakAssetReference.h | 4 ++-- Source/Engine/Scripting/ScriptingObjectReference.h | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/Engine/Content/AssetReference.h b/Source/Engine/Content/AssetReference.h index 82ef5adce..fc347585f 100644 --- a/Source/Engine/Content/AssetReference.h +++ b/Source/Engine/Content/AssetReference.h @@ -150,22 +150,22 @@ public: return *this; } - FORCE_INLINE bool operator==(T* other) + FORCE_INLINE bool operator==(T* other) const { return _asset == other; } - FORCE_INLINE bool operator==(const AssetReference& other) + FORCE_INLINE bool operator==(const AssetReference& other) const { return _asset == other._asset; } - FORCE_INLINE bool operator!=(T* other) + FORCE_INLINE bool operator!=(T* other) const { return _asset != other; } - FORCE_INLINE bool operator!=(const AssetReference& other) + FORCE_INLINE bool operator!=(const AssetReference& other) const { return _asset != other._asset; } diff --git a/Source/Engine/Content/SoftAssetReference.h b/Source/Engine/Content/SoftAssetReference.h index a65099870..dd1251d61 100644 --- a/Source/Engine/Content/SoftAssetReference.h +++ b/Source/Engine/Content/SoftAssetReference.h @@ -105,19 +105,19 @@ public: } public: - FORCE_INLINE bool operator==(T* other) + FORCE_INLINE bool operator==(T* other) const { return Get() == other; } - FORCE_INLINE bool operator==(const SoftAssetReference& other) + FORCE_INLINE bool operator==(const SoftAssetReference& other) const { return GetID() == other.GetID(); } - FORCE_INLINE bool operator!=(T* other) + FORCE_INLINE bool operator!=(T* other) const { return Get() != other; } - FORCE_INLINE bool operator!=(const SoftAssetReference& other) + FORCE_INLINE bool operator!=(const SoftAssetReference& other) const { return GetID() != other.GetID(); } diff --git a/Source/Engine/Content/WeakAssetReference.h b/Source/Engine/Content/WeakAssetReference.h index 1124e9656..7e756211a 100644 --- a/Source/Engine/Content/WeakAssetReference.h +++ b/Source/Engine/Content/WeakAssetReference.h @@ -137,12 +137,12 @@ public: return *this; } - FORCE_INLINE bool operator==(T* other) + FORCE_INLINE bool operator==(T* other) const { return _asset == other; } - FORCE_INLINE bool operator==(const WeakAssetReference& other) + FORCE_INLINE bool operator==(const WeakAssetReference& other) const { return _asset == other._asset; } diff --git a/Source/Engine/Scripting/ScriptingObjectReference.h b/Source/Engine/Scripting/ScriptingObjectReference.h index 3bae0f7a5..26c75687b 100644 --- a/Source/Engine/Scripting/ScriptingObjectReference.h +++ b/Source/Engine/Scripting/ScriptingObjectReference.h @@ -164,19 +164,19 @@ public: public: - FORCE_INLINE bool operator==(T* other) + FORCE_INLINE bool operator==(T* other) const { return _object == other; } - FORCE_INLINE bool operator!=(T* other) + FORCE_INLINE bool operator!=(T* other) const { return _object != other; } - FORCE_INLINE bool operator==(const ScriptingObjectReference& other) + FORCE_INLINE bool operator==(const ScriptingObjectReference& other) const { return _object == other._object; } - FORCE_INLINE bool operator!=(const ScriptingObjectReference& other) + FORCE_INLINE bool operator!=(const ScriptingObjectReference& other) const { return _object != other._object; }