ערוך

שתף באמצעות


HashSet<T>.TryGetAlternateLookup<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>
 bool TryGetAlternateLookup([Runtime::InteropServices::Out] System::Collections::Generic::HashSet<T>::AlternateLookup<TAlternate> % lookup);
public bool TryGetAlternateLookup<TAlternate> (out System.Collections.Generic.HashSet<T>.AlternateLookup<TAlternate> lookup);
member this.TryGetAlternateLookup : AlternateLookup -> bool
Public Function TryGetAlternateLookup(Of TAlternate) (ByRef lookup As HashSet(Of T).AlternateLookup(Of TAlternate)) As Boolean

Type Parameters

TAlternate

The alternate type of instance for performing lookups.

Parameters

lookup
HashSet<T>.AlternateLookup<TAlternate>

The created lookup instance when the method returns true, or a default instance that should not be used if the method returns false.

Returns

true if a lookup could be created; otherwise, false.

Remarks

The set must use a comparer that implements IAlternateEqualityComparer<TAlternate,T> with TAlternate and T. If it doesn't, the method returns false.

Applies to