static bool IsDistinct(IEnumerable input)
{
var ordered = input.OrderBy(item=>item);
var enumerator =ordered.GetEnumerator();
if(enumerator.MoveNext()==false) return true;
T previous=enumerator.Current;
while(enumerator.MoveNext())
{
T current = enumerator.Current;
if(previous.Equals(current)) return false;
previous = current;
}
return true;
}
]]>