Hi,
For some important reasons I've implemented a new type as
a class instead of a struct.
The type is called NKTd and I've overloaded the ==
operator as follows
public static bool operator==( NKTd a, NKTd b )
{
return ( a.value == b.value );
}
Now, if x is a NKTd (or pointer to) and I want to
evaluate something like:
if ( x == null)
{
....
}
The above will invoke the == overloaded code, and I'll
get a runtime error.
Is there a way to 'override' the left side to force it to
look at the reference.
I've tried 'if ( (object)x == null)' and it works fine,
but not very elegant to my opinion.
best regards