C# HashSet CreateSetComparer

Description

HashSet CreateSetComparer returns an IEqualityComparer object that can be used for equality testing of a HashSet object.

Syntax

HashSet.CreateSetComparer has the following syntax.


public static IEqualityComparer<HashSet<T>> CreateSetComparer()

Example

Returns an IEqualityComparer object that can be used for equality testing of a HashSet object.


/*from ww  w.  j  a  v a 2 s.c om*/

using System;
using System.Collections.Generic;

public class MainClass
{
    public static void Main(String[] argv){
        IEqualityComparer<HashSet<int>> c = HashSet<int>.CreateSetComparer();
    
  }
}




















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




HashSet
LinkedList
LinkedListNode
List
Queue
SortedSet
Stack