Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Collections.​Generic.​ReferenceEqualityComparer

Assembly: System.Collections

Inheritance: object → ReferenceEqualityComparer

Implemented Interfaces

An <see cref="T:System.Collections.Generic.IEqualityComparer`1" /> that uses reference equality ( <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> ) instead of value equality ( <see cref="M:System.Object.Equals(System.Object)" /> ) when comparing two object instances.

Properties

Instance
Gets the singleton <see cref="T:System.Collections.Generic.ReferenceEqualityComparer" /> instance.

Methods

public bool
Equals​(object x, object y)
Determines whether two object references refer to the same object instance.
Returns <see langword="true" /> if both <paramref name="x" /> and <paramref name="y" /> refer to the same object instance or if both are <see langword="null" /> ; otherwise, <see langword="false" /> .
x The first object to compare.
y The second object to compare.
public int
GetHashCode​(object obj)
Returns a hash code for the specified object. The returned hash code is based on the object identity, not on the contents of the object.
Returns A hash code for the identity of <paramref name="obj" /> .
obj The object for which to retrieve the hash code.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object