views:

364

answers:

6
+1  A: 

HashSet Class

Dzmitry Huba
A: 

You can take a look at the HashSet<T> collection.

kek444
A: 

Since .net 3.5, there is the HashSet<T> which implements a Set. Not sure if it's totally equal to C++'s set though.

Michael Stum
+7  A: 

Until .NET3.5, no (don't ask me why it took them so long to get these fundamentals added. (There's still no heap class, afaik. The .NET collection classes are surprisingly lackluster).

In 3.5, you have HashSet<T>. It's more like the TR1 unordered_set than std::set though, in that it's unordered, where std::set uses a tree structure internally.

Of course there are several third-party libraries offering to fix these shortcomings.

I've looked at C5 (as suggested by Pratik) before, but never used it. But it seems to be pretty good quality, and has a Set class.

jalf
+4  A: 

I can suggest The C5 Generic Collection Library that has a hash set collection class among many others.

Pratik
+1 for mentioning a .NET 2.0 set implementation
SealedSun
+1  A: 

The answer to your question is YES. Check out the Jeff Richter's amazing Power Collections library for some of the most commonly used STL equivalent collection types for .NET. On an unrelated note he also has a Power Threading library

Abhijeet Patel
You beat me! I deleted my answer pointing at Power Collections. I second Abhijeet in thinking that Power Collections is the library you are looking for.
spoon16
Ha! :-) BTW Richter rocks!
Abhijeet Patel