[API Proposal]: Add OrderedSet<T>
#110882
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Collections
Milestone
Background and motivation
Bringing this issue back since it was closed without being resolved. (#24828 and dotnet/corefxlab#2457):
"Sometimes I've come across places when needing a HashSet where the insertion order of the elements is important to me. Unfortunately, .NET does not have an OrderedSet class even though it has a SortedSet which to me has less value but perhaps not to others. This has led to users rolling their own solution, typically by using a combination of a LinkedList and Dictionary field resulting in the worst of both worlds in terms of performance and resulting in larger memory usage, and even worse sometimes users instead rely on implementation details of HashSet for ordering which is quite dangerous."
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: