Class ComparerNullEquatable<T>

An equatable compatible with a given comparer. All hash codes are 0, meaning that anything based on hash codes will be quite inefficient.

Note: this will give a new Equatable each time created!

Type parameters:
T

Implements

IEquatable<T>

Bases

object

Constructor overview

ComparerNullEquatable<T>(IComparer<T> comparer)

Method overview

Equals(T item1, T item2),
Equals(object obj), Inherited from object,
Finalize(), Inherited from object,
GetHashCode(T item),
GetHashCode(), Inherited from object,
GetType(), Inherited from object,
MemberwiseClone(), Inherited from object,
ToString(), Inherited from object

Constructor details

ComparerNullEquatable<T>(IComparer<T> comparer) Create a trivial IEquatable<T> compatible with the IComparer<T>comparer
Parameters:
comparer:

Method details

F bool Equals(T item1, T item2) Equality of two items as defined by the comparer.
Returns:
Parameters:
item1:
item2:
F int GetHashCode(T item) A trivial, inefficient hash fuction. Compatible with any equality relation.
Returns:0
Parameters:
item: