i have created a class that have functionality for the == operator, but i would like to test if the values are null, but when i test for this i start a never ending loop. How can i do the following without creating a never ending loop?
public struct MyClass
{
private string Value;
public static bool operator ==(MyClass left, MyClass right)
{
if (left == null && right == null)
return true;
if (left == null || right == null)
return false;
return left.Equals(right);
}
}