Create IEqualityComparer object that can be used for equality testing of a HashSet in CSharp
Description
The following code shows how to create IEqualityComparer object that can be used for equality testing of a HashSet.
Example
// w w w. j a va 2 s. com
using System;
using System.Collections.Generic;
public class MainClass
{
public static void Main(String[] argv){
IEqualityComparer<HashSet<int>> c = HashSet<int>.CreateSetComparer();
Console.WriteLine(c);
}
}
The code above generates the following result.