Preferred way to test against many discrete values?
<p>I have the following scenario:</p>

<pre><code>variable in {12, 4, 999, ... }:
</code></pre>

<p>Where there are about 100 discrete values in the list. I am writing a parser to convert this to C++, and the only ways that I can think of to do it are 100 case statements, or 100 if ==</p>

<p>Is one preferred to the other, or is there an all round better way to do this?</p>

<p>I should clarify, the values are constant integers. Thanks</p>
