- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
How does one compare two structs? My understanding is that structs are treated like objects and so they have reference semantics rather than value. That would mean that
Or should we go about defining our own equals method in the struct, e.g.
How does one compare two structs? My understanding is that structs are treated like objects and so they have reference semantics rather than value. That would mean that
myStruct A == myStruct B
is true iff they point to the exact same object/data structure in memory? Or should we go about defining our own equals method in the struct, e.g.
method equals takes myStruct B returns boolean
?