title: Most C++'ish way to check if value belongs to certain static set
body: <p>Let's say that I want to write something like this (the <code>{1, 3, 7, 42, 69, 550123}</code> set is known before compilation):</p>
  <pre><code>int x;
  ...
  if (x == 1 || x == 3 || x == 7 || x == 42 || x == 69 || x == 5550123)
  {
    ...
  }
  </code></pre>
  <p>The condition looks ugly because we have 9 extra symbols (&quot;<code>|| x ==</code>&quot;) for each possible value. How can I rewrite it in a more C++'ish way?</p>
  <p>My best guess is:</p>
  <pre><code>int x;
  ...
  const std::unordered_set&lt;int&gt; v = {1, 3, 7, 42, 69, 5550123};
  if (v.count(x))
  {
    ...
  }
  </code></pre>
  <p>It has O(1) average complexity with some memory and time overhead, but still looks kinda ugly.</p>