แก้ไข

แชร์ผ่าน


HashSet<T>.GetAlternateLookup<TAlternate> Method

Definition

Gets an instance of a type that can be used to perform operations on the current HashSet<T> using a TAlternate instead of a T.

public:
generic <typename TAlternate>
 System::Collections::Generic::HashSet<T>::AlternateLookup<TAlternate> GetAlternateLookup();
public System.Collections.Generic.HashSet<T>.AlternateLookup<TAlternate> GetAlternateLookup<TAlternate> ();
member this.GetAlternateLookup : unit -> System.Collections.Generic.HashSet<'T>.AlternateLookup<'Alternate>
Public Function GetAlternateLookup(Of TAlternate) () As HashSet(Of T).AlternateLookup(Of TAlternate)

Type Parameters

TAlternate

The alternate type of instance for performing lookups.

Returns

The created lookup instance.

Exceptions

The set's comparer is not compatible with TAlternate.

Remarks

The set must use a comparer that implements IAlternateEqualityComparer<TAlternate,T> with TAlternate and T. If it doesn't, an exception is thrown.

Applies to