Table of Contents

Class ReferenceEqualityComparer<T>

Namespace
Stride.Core
Assembly
Stride.Core.dll

A Comparator to use ReferenceEquals(object, object) method.

public class ReferenceEqualityComparer<T> : EqualityComparer<T>, IEqualityComparer<T>, IEqualityComparer where T : class

Type Parameters

T

Type of the comparer

Inheritance
ReferenceEqualityComparer<T>
Implements
Inherited Members

Properties

Default

Gets the default.

public static IEqualityComparer<T> Default { get; }

Property Value

IEqualityComparer<T>

Methods

Equals(T, T)

When overridden in a derived class, determines whether two objects of type T are equal.

public override bool Equals(T x, T y)

Parameters

x T

The first object to compare.

y T

The second object to compare.

Returns

bool

true if the specified objects are equal; otherwise, false.

GetHashCode(T)

When overridden in a derived class, serves as a hash function for the specified object for hashing algorithms and data structures, such as a hash table.

public override int GetHashCode(T obj)

Parameters

obj T

The object for which to get a hash code.

Returns

int

A hash code for the specified object.

Exceptions

ArgumentNullException

The type of obj is a reference type and obj is null.