diff --git a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp index 82dcd40..56bec7f 100644 --- a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp @@ -230,6 +230,7 @@ void TestOptional() TempO.Reset(); always_check(TempO == TempO); + always_check(!(TempO != TempO)); always_check(TempO.Get(500) == 500); int32 TempP = 200; diff --git a/Redcraft.Utility/Source/Public/Templates/Optional.h b/Redcraft.Utility/Source/Public/Templates/Optional.h index bb94f3a..16eda27 100644 --- a/Redcraft.Utility/Source/Public/Templates/Optional.h +++ b/Redcraft.Utility/Source/Public/Templates/Optional.h @@ -223,7 +223,7 @@ template constexpr bool operator!=(const TOptional& LHS, const TOptional& RHS) { if (LHS.IsValid() != RHS.IsValid()) return true; - if (LHS.IsValid() == false) return true; + if (LHS.IsValid() == false) return false; return *LHS != *RHS; }