C# SortedSet Comparer
Description
SortedSet
gets the IEqualityComparer
Syntax
SortedSet.Comparer
has the following syntax.
public IComparer<T> Comparer { get; }
Example
using System;//from w w w. jav a 2 s . c o m
using System.Collections.Generic;
public class MainClass{
public static void Main(String[] argv){
SortedSet<int> evenNumbers = new SortedSet<int>();
for (int i = 0; i < 5; i++)
{
evenNumbers.Add(i * 2);
}
Console.WriteLine(evenNumbers.Comparer);
}
}
The code above generates the following result.