title: More readable way to compare variable to list of values in if statement?
body: <p>How can I compare a variable to a list of values of the same type in an <code>if</code> statement and make it readable and clean?</p>
  
  <p>For example, I have the following, but there are a lot of values, and I want to make it more readable.</p>
  
  <pre><code>if ((lst-&gt;type == 'p' || lst-&gt;type == 'x' || lst-&gt;type == 'X' ||
      lst-&gt;type == 'o' || lst-&gt;type == 'O' || (lst-&gt;type == 'd' ||
      lst-&gt;type == 'i' || lst-&gt;type == 'D'))
  </code></pre>