   [.net] Container equivalent to C++ set?
  I've only been working with C#/.NET for a short time, but I generally find it really easy to use. Every time I've wanted to do something, it took one Google search to turn up something in the standard library. Today, though, I wanted a container that worked like the STL set from C++.For all of the web-pages that brag about how much better the .NET containers are than the STL ones, and how you should never need to write your own, I can't find anything that works like set. I want a collection of values that remains sorted. There doesn't seem to be anything... All of the sorted containers use both keys and values. It seems like I either have to write my own, or do something nasty like:SortedList< MyType, int >At which point I'll simply ignore the value portion and end up using .Keys to do most of my work. Have I overlooked something? Or is there a better solution than my (ab)use of SortedList?   
  Look at System.Collections, they may have what you are looking for.theTroll   ;  I'd be interested in this too. It seems a strange omission.   ;  There's nothing quite like it.  It should be fairly easy to grab some code for an AVL or RB tree from the net and create an ISet interface for it tough.   ;  Thanks for the replies. I just wanted to be sure I hadn't overlooked anything. I checked every container in Collections and the sub-namespaces, but no luck. Anyways, I've simply used one of the dictionary style (Key/Value) containers for now, wrapped in a one-off container that support indexing and enumeration. I might go back later and implement a proper generic Set, but my application is simple enough that this works.   