S
S. Lorétan
Hello.
I have some structs in different namespaces/classes/other structs and I
sometime have to check if it contains something or not.
myStruct == null doesn't work.
I've currently done it by creating a IsNull method in my structs:
struct TestStruct {
public int Value;
public bool IsNull() {
return this.Equals(new TestStruct());
}
}
Is this correct? Is there another way?
I have some structs in different namespaces/classes/other structs and I
sometime have to check if it contains something or not.
myStruct == null doesn't work.
I've currently done it by creating a IsNull method in my structs:
struct TestStruct {
public int Value;
public bool IsNull() {
return this.Equals(new TestStruct());
}
}
Is this correct? Is there another way?