HashSet<T>.IntersectWith(IEnumerable<T>) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
修改目前 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> 物件做比較。
實作
- 屬性
例外狀況
other 是 null。
備註
若參數所代表other的集合與當前HashSet<T>物件具有相同的等號比較器,HashSet<T>則此方法為 O(n) 運算。 否則,此方法為 O(n + m) 運算,其中 n 是 Count ,是 m 中的 other元素數。