title: Refactor if-else-if structure
body: <p>How can I refactor the following C++ code? I am using C++11 in my program</p>
  
  <pre><code>void f(int a, int b, int c, int d, int e, int f) {
  
    // MAX1..MAX6 are constants, N1..N6 are constants
      if( a &gt; MAX1) {
          .. code block 1..
      }
      else if(b &gt; MAX2) {
          .. code block 2..
      }
      else if(c &gt; MAX3) {
          .. code block ..
      }
      else if(d &gt; MAX4) {
          .. code block 3 ..
      }
      else if(e &gt; MAX5) {
          .. code block 4 ..
      }
      else if(f &gt; MAX6) {
          .. code block5 ..
      }
      else if(( a &gt; N1) &amp;&amp; ( b &gt; N2)) {
              .. code block 6 ..
      }
      else if(( c &gt; N3) &amp;&amp; ( d &gt; N4)) {
              .. code block 7 ..
      }
      else if (( e &gt; N5) &amp;&amp; ( f &gt; N6)) {
              .. code block 8 ..
      }
      else if (( a &gt; N1) &amp;&amp; ( b &gt; N2) &amp;&amp; (d &gt; N4)) {
              .. code block 9 ..
      }
      else if (..some combination of (a &gt; N1) to (f &gt; N6)...) {
              // there are more than 30 such combinations in my code
              .. code block XX ..
      }
      else {
              .... code block ....
      }
  </code></pre>