語言

HashSet<T>.CreateSetComparer 方法

定義

回傳 IEqualityComparer 一個可用於物件等性測試 HashSet<T> 的物件。

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> 物件。

備註

該 IEqualityComparer 物件只在一個層級檢查相等性;不過,你可以串連其他層級的比較器,進行更深入的等性測試。

呼叫此方法需操作 O(1)。

適用於