Hi, let's suppose I have a
class A
{
int x;
...
public static bool operator == (A a1 , A a2)
{
return (a1.x==a2.x);
}
}
But, outside the class, I have a problem when I try to test a probably not
initialized class.
For instance, think about this code:
public void myFunc()
{
A a1;
A a2;
.....
if (a1 == null)
{
//some null value handling
}
....
}
The problem is that testing a1==null creates recursive calls to the operator
== of class A.
How do I test if something is null without having to invoke the == operator
for that "something"?
Tnx in advance.