Skip to content

Commit

Permalink
Update how-to-define-value-equality-for-a-type.md
Browse files Browse the repository at this point in the history
spelling error
  • Loading branch information
rcseacord authored Dec 21, 2016
1 parent c3d674c commit 43a4cb9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ When you define a class or struct, you decide whether it makes sense to create a

[!code-cs[csProgGuideStatements#20](../../../csharp/programming-guide/classes-and-structs/codesnippet/CSharp/how-to-define-value-equality-for-a-type_2.cs)]

For structs, the default implementation of <xref:System.Object.Equals%28System.Object%29?displayProperty=fullName> (which is the overridden version in <xref:System.ValueType?displayProperty=fullName>) performs a value equality check by using reflection to compare the values of every field in the type. When an implementer overrides the virtual `Equals` method in a stuct, the purpose is to provide a more efficient means of performing the value equality check and optionally to base the comparison on some subset of the struct's field or properties.
For structs, the default implementation of <xref:System.Object.Equals%28System.Object%29?displayProperty=fullName> (which is the overridden version in <xref:System.ValueType?displayProperty=fullName>) performs a value equality check by using reflection to compare the values of every field in the type. When an implementer overrides the virtual `Equals` method in a struct, the purpose is to provide a more efficient means of performing the value equality check and optionally to base the comparison on some subset of the struct's field or properties.

The [==](../../../csharp/language-reference/operators/equality-comparison-operator.md) and [!=](../../../csharp/language-reference/operators/not-equal-operator.md) operators cannot operate on a struct unless the struct explicitly overloads them.

## See Also
[Equality Comparisons](../../../csharp/programming-guide/statements-expressions-operators/equality-comparisons.md)
[C# Programming Guide](../../../csharp/programming-guide/index.md)
[C# Programming Guide](../../../csharp/programming-guide/index.md)

0 comments on commit 43a4cb9

Please sign in to comment.