SortedDictionary<TKey,TValue>.Comparer 속성

정의

IComparer<T>의 요소를 정렬하는 데 사용되는 SortedDictionary<TKey,TValue>을 가져옵니다.

public:
 property System::Collections::Generic::IComparer<TKey> ^ Comparer { System::Collections::Generic::IComparer<TKey> ^ get(); };
public System.Collections.Generic.IComparer<TKey> Comparer { get; }
member this.Comparer : System.Collections.Generic.IComparer<'Key>
Public ReadOnly Property Comparer As IComparer(Of TKey)

속성 값

IComparer<TKey>

IComparer<T>의 요소를 정렬하는 데 사용되는 SortedDictionary<TKey,TValue>입니다.

설명

SortedDictionary<TKey,TValue> 키 비교를 수행하려면 비교자 구현이 필요합니다. 매개 변수를 허용하는 생성자를 사용하여 제네릭 인터페이스의 IComparer<T> 구현을 comparer 지정할 수 있습니다. 그렇지 않으면 기본 제네릭 같음 비교자가 Comparer<T>.Default사용됩니다. 형식 TKey 이 제네릭 인터페이스를 System.IComparable<T> 구현하는 경우 기본 비교자는 해당 구현을 사용합니다.

이 속성의 값을 가져오는 것은 O(1) 작업입니다.

적용 대상

추가 정보