Sets don't generally have indexes. If position is important to you, you should be using a List<T>
instead of (or possibly as well as) a set.
Now SortedSet<T>
in .NET 4 is slightly different, in that it maintains a sorted value order. However, it still doesn't implement IList<T>
, so access by index with ElementAt
is going to be slow.
If you could give more details about why you want this functionality, it would help. Your use case isn't really clear at the moment.