views:

62

answers:

3

I have a list of values that i need to check against a constant list to know wheter they are present or not (one by one).

Im using a dictionary buy it doesnt seem logical to have the value two times (key, value)...isnt there any class specialized for this case (and faster if possible)?

Also it would me more reasonable if it could be declared as a constant being a predefined list

+6  A: 

Sounds like you need a HashSet.

Carra
Its there a way to define it as a const? Or a counterpart version that does it?
ase69s
@ase69s: Do you mean you want it to be `readonly`?
Daniel Pryden
No, i mean a value constant from compile time... like const string="test"
ase69s
+2  A: 

Use HashSet<T>.

Julien Lebosquain
+2  A: 

HashSet

Andrey