title: Shorthand for checking for equality to multiple possibilities
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/639496/c-comparing-bunch-of-values-with-a-given-one">C++ comparing bunch of values with a given one</a>  </p>
  </blockquote>
  
  
  
  <p>I'm needing to check for equality in a for loop in C++, however the loop needs to work for x equaling multiple possibilities.  </p>
  
  <p>For example, right now I have something similar to:</p>
  
  <pre><code>if(x==a || x==b || x==c || x==d || x==e || x==f || x==g || x==h)
  {
      //loop body
  }
  </code></pre>
  
  <p>But with the number I have, it looks messy and I was wondering if there was a shorthand way of saying "if (x == (any of these))" or if writing them all out was the only option.</p>
  
  <p>Thanks!</p>