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) 操作です。ここで n 、 は Countmother要素の数です。

適用対象