ReferenceEqualityComparer<T> Class
- Namespace
- Kampute.DocToolkit.Collections
- Assembly
- Kampute.DocToolkit.dll
Definition
Provides an equality comparer that uses reference equality (object.ReferenceEquals(object, object)) instead of value equality.
public sealed class ReferenceEqualityComparer<T> : IEqualityComparer<T>
where T : class- Inheritance
- object
- ReferenceEqualityComparer<T>
- Implements
Type Parameters
T- The type of objects to compare.
Remarks
Properties
| Instance | Gets the singleton instance of ReferenceEqualityComparer<T>. |
Methods
| Equals(T, T) | Determines whether two object references refer to the same instance. |
| GetHashCode(T) | Returns an identity-based hash code for the specified object. |

Hash codes are computed using RuntimeHelpers.GetHashCode(object), which returns an identity-based hash code rather than a content-based one.