SortedSet<T> Constructor (IComparer<T>^)

.NET Framework (current version)
 

Initializes a new instance of the SortedSet<T> class that uses a specified comparer.

Namespace:   System.Collections.Generic
Assembly:  System (in System.dll)

public:
SortedSet(
	IComparer<T>^ comparer
)

Parameters

comparer
Type: System.Collections.Generic::IComparer<T>^

The default comparer to use for comparing objects.

Exception Condition
ArgumentNullException

comparer is null.

If comparer does not implement IComparable<T>, you must specify an IComparer<T> object to be used.

The following example defines a comparer (ByFileExtension) that is used to construct a sorted set that sorts file names by their extensions. This code example is part of a larger example provided for the SortedSet<T> class.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: