fix(templates): fix TOptional's operator!= returned an wrong value for invalid value
This commit is contained in:
parent
48a344796a
commit
f7b611febc
@ -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;
|
||||
|
@ -223,7 +223,7 @@ template <typename T, typename U>
|
||||
constexpr bool operator!=(const TOptional<T>& LHS, const TOptional<U>& RHS)
|
||||
{
|
||||
if (LHS.IsValid() != RHS.IsValid()) return true;
|
||||
if (LHS.IsValid() == false) return true;
|
||||
if (LHS.IsValid() == false) return false;
|
||||
return *LHS != *RHS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user