HashSet<T>.CreateSetComparer HashSet<T>.CreateSetComparer HashSet<T>.CreateSetComparer HashSet<T>.CreateSetComparer Method

定义

返回 IEqualityComparer 对象,该对象可用于对 HashSet<T> 对象进行相等测试。Returns an IEqualityComparer object that can be used for equality testing of a HashSet<T> object.

public:
 static System::Collections::Generic::IEqualityComparer<System::Collections::Generic::HashSet<T> ^> ^ CreateSetComparer();
public static System.Collections.Generic.IEqualityComparer<System.Collections.Generic.HashSet<T>> CreateSetComparer ();
static member CreateSetComparer : unit -> System.Collections.Generic.IEqualityComparer<System.Collections.Generic.HashSet<'T>>
Public Shared Function CreateSetComparer () As IEqualityComparer(Of HashSet(Of T))

返回

IEqualityComparer 对象,可用于对 HashSet<T> 对象进行深入的相等测试。An IEqualityComparer object that can be used for deep equality testing of the HashSet<T> object.

注解

IEqualityComparer对象只在一个级别上检查相等性; 不过,你可以在其他级别链接到比较器来执行更深入的相等测试。The IEqualityComparer object checks for equality at only one level; however, you can chain together comparers at additional levels to perform deeper equality testing.

调用此方法的运算复杂度为 O (1)。Calling this method is an O(1) operation.

适用于