HashSet<T>.IntersectWith(IEnumerable<T>) 方法

定義

修改目前的 HashSet<T> 物件,以便僅包含該物件和指定之集合中同時出現的項目。

public:
 virtual void IntersectWith(System::Collections::Generic::IEnumerable<T> ^ other);
public:
 void IntersectWith(System::Collections::Generic::IEnumerable<T> ^ other);
public void IntersectWith (System.Collections.Generic.IEnumerable<T> other);
[System.Security.SecurityCritical]
public void IntersectWith (System.Collections.Generic.IEnumerable<T> other);
abstract member IntersectWith : seq<'T> -> unit
override this.IntersectWith : seq<'T> -> unit
[<System.Security.SecurityCritical>]
member this.IntersectWith : seq<'T> -> unit
[<System.Security.SecurityCritical>]
abstract member IntersectWith : seq<'T> -> unit
override this.IntersectWith : seq<'T> -> unit
Public Sub IntersectWith (other As IEnumerable(Of T))

參數

other
IEnumerable<T>

要與目前 HashSet<T> 物件比較的集合。

實作

屬性

例外狀況

othernull

備註

如果 參數所 other 表示的集合是 HashSet<T> 與目前 HashSet<T> 物件相同的相等比較子集合,則此方法是 O (n) 作業。 否則,這個方法是 O (n + m) 作業,其中 是 Count ,而 nm 是中的other元素數目。

適用於