P
Paul E Collins
I want to implement the equality operation for one of my classes, so
that I can use List<blah>.Contains for a list of those objects instead
of writing a loop to compare with each item in the list.
When I add ": IEquatable" to my class definition, I get a compile
error:
"Using the generic type 'System.IEquatable<T>' requires '1' type
arguments."
What type am I supposed to specify? I just want to write a method that
compares two instances for equality, and the .NET 2.0 docs suggest I
should be using this rather than overriding Equals.
Eq.
that I can use List<blah>.Contains for a list of those objects instead
of writing a loop to compare with each item in the list.
When I add ": IEquatable" to my class definition, I get a compile
error:
"Using the generic type 'System.IEquatable<T>' requires '1' type
arguments."
What type am I supposed to specify? I just want to write a method that
compares two instances for equality, and the .NET 2.0 docs suggest I
should be using this rather than overriding Equals.
Eq.