C# SortedSet Comparer

Description

SortedSet Comparer gets the IEqualityComparer object that is used to determine equality for the values in the SortedSet .

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.





















Home »
  C# Tutorial »
    System.Collections.Generic »




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack