HashSet<T>.IntersectWith(IEnumerable<T>) Metodo

Definizione

Modifica l'oggetto corrente HashSet<T> in modo che contenga solo gli elementi presenti nell'oggetto e nella raccolta specificata.

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))

Parametri

other
IEnumerable<T>

Insieme da confrontare con l'oggetto corrente HashSet<T> .

Implementazioni

Attributi

Eccezioni

other è null.

Commenti

Se la raccolta rappresentata dal other parametro è una HashSet<T> raccolta con lo stesso operatore di confronto di uguaglianza dell'oggetto corrente HashSet<T> , questo metodo è un'operazione O(n). In caso contrario, questo metodo è un'operazione O(n + m), dove n è Count e m è il numero di elementi in .other

Si applica a