65.9K
CodeProject is changing. Read more.
Home

SortedSet Linq Extension Method

starIconstarIconstarIconstarIconstarIcon

5.00/5 (7 votes)

Oct 26, 2010

CPOL
viewsIcon

7233

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:
public static SortedSet<T> ToSortedSet<T>(this IEnumerable<T> t)
{
    return new SortedSet<T>(t);
}