What is a
- preferably generic;
- unique(IComparable/IEquitable) valued
collection of objects for .NET 2?
(à la List<T>, or an equivalent of HashSet<T> from .NET 3.5, but without ordered items)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately, the first good framework class for this is the HashSet, which you will only get access to with .Net 3.5.
If you are stuck in previous versions., the options are not as nice. The most common is to usea Dictionary type where the Key is the value that you are trying to store. You can wrap this in your own class fairly easily.
If you are willing to go outside the framework all together, there are collections of data structures for .Net, such as NGenerics.