Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

SortedSet Linq Extension Method

5.00/5 (7 votes)
26 Oct 2010CPOL 7.2K  
Since SortedSet has a constructor that takes an IEnumerable parameter, the ToSortedSet extension method can be greatly simplified:public static SortedSet ToSortedSet(this IEnumerable t){ return new SortedSet(t);}
Since SortedSet has a constructor that takes an IEnumerable<T> parameter, the ToSortedSet extension method can be greatly simplified:

XML
public static SortedSet<T> ToSortedSet<T>(this IEnumerable<T> t)
{
    return new SortedSet<T>(t);
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)