SortedSet<'T>.CreateSetComparer Method (IEqualityComparer<'T>)
.NET Framework (current version)
Returns an IEqualityComparer object, according to a specified comparer, that can be used to create a collection that contains individual sets.
Assembly: System (in System.dll)
static member CreateSetComparer : memberEqualityComparer:IEqualityComparer<'T> -> IEqualityComparer<SortedSet<'T>>
Parameters
- memberEqualityComparer
-
Type:
System.Collections.Generic.IEqualityComparer<'T>
The comparer to use for creating the returned comparer.
Return Value
Type: System.Collections.Generic.IEqualityComparer<SortedSet<'T>>A comparer for creating a collection of sets.
The memberEqualityComparer and the current SortedSet<'T> must have the same definition of equality.
You can use the comparer returned by this method in the SortedSet<'T>.SortedSet<'T>(IEnumerable<'T>, IComparer<'T>) constructor to create a hash table of individual sets.
The following example uses the CreateSetComparer method to create a set of sets. This code example is part of a larger example provided for the SortedSet<'T> class.
.NET Framework
Available since 4.0
Available since 4.0
Show: