title: C: macro to check A < B < C at compile time using static assert?
body: <p>I've got some macros:</p>
  <pre><code>#define D(x)        (((uint64_t) 1) &lt;&lt; (x))
  
  #define DATA0           D(0)
  #define DATA1           D(1)
  #define DATA2           D(2)
  #define DATA3           D(3)
  #define DATA4           D(4)
  #define DATA5           D(5)
  
  #define COMB1           DATA1 | DATA4 | DATA5
  #define COMB2           DATA0 | DATA2 | DATA4
  #define COMB3           DATA2 | DATA3
  #define COMB4           DATA2 | DATA3 | DATA1
  
  </code></pre>
  <p>One important thing is that <code>COMB</code>s need to have data ordered in such a way that <code>dataA &lt; dataB &lt; dataC &lt; ... &lt; dataN</code>, so in the above cases all are OK except <code>COMB4</code>.</p>
  <p>Would it be possible to do a static assert and check this at compile time? For COMB1 <code>(DATA1 &lt; DATA4 &lt; DATA5)</code>, for COMB2 <code>(DATA0 &lt; DATA2 &lt; DATA4)</code>, and finally fail for <code>COMB4</code> because <code>DATA3 &gt; DATA1</code>?</p>