title: Expand a macro based on its parameter value
body: <p>I have a macro that looks like this:</p>
  
  <pre><code>M(id,...)
  </code></pre>
  
  <p>I would like it to expand to nothing if <code>id == 0</code> and something else otherwise. </p>
  
  <p><strong>Is this possible? If so, how?</strong> </p>
  
  <p>My first instinct was to try something like this:</p>
  
  <pre><code>#define M(id,...) M##id(__VA_ARGS__)
  #define M0(...)
  #define M_NOT_0(...) some_code(__VA_ARGS__)
  </code></pre>
  
  <p>But the last line here is obviously not valid, and I can't figure out a way to make this pattern work.</p>
  
  <p>Notes: </p>
  
  <ul>
  <li>The <code>id</code> is an integer between 0 and 255, but ideally I'd like to avoid creating 256 separate macro definitions.</li>
  <li>Please do not challenge the premise of the question. The <code>M(id,...)</code> macro itself cannot be changed.</li>
  <li>No assumptions about the final code being expanded to can be made.</li>
  </ul>