BACKGROUND: I have a custom class written in C# (2005), with code similar to the following:
public class Savepoint
{
public int iOffset; /* Starting offset in main journal */
public u32 nOrig; /* Original number of pages in file */
public u32 iSubRec; /* Index of first record in sub-journal */
};
After a variable has been declared with Savepoint sp; I can test to see if has been instantiated with code similar to:
if (sp != null) {...}
QUESTION: Is it possible to overload the class operator somehow so that I can also use the following syntax as well: if (sp) {...} or if (sp != 0) {...}
PS: I have no real good reason for wanting to write if (sp) other than force of habit.