Fastest way to check if a number is in a list of numbers
<p>I need to check whether an ID (a long integer) is in a list of  ~10,000 IDs. I need to do this about 10^9 times over on a loop, and speed is relatively important. Is using a c++ set the quickest way to do this? Something like:</p>

<pre><code>set&lt;long&gt; myset;

// (Populate myset)

long id = 123456789;

if(myset.find(id) != myset.end()) {
     // id is in set
}
</code></pre>

<p>Or is there a quicker way?</p>
