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?
--
S. Lorétan <http://www.tynril.info/(This link is in french. Sorry.)
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?
--
S. Lorétan <http://www.tynril.info/(This link is in french. Sorry.)
Comment