title: how to make a macro to generate code in a for loop?
body: <p>I noticed the following code in a code review:</p>
  
  <pre><code>for (int i = 0; i &lt; 50; ++i) {
    switch(i) {
      case 0:
        return f1();
      case 1:
        return f2();
      ...
      case 49:
        return f50();
    }
  }
  </code></pre>
  
  <p>and I'm wondering if there's any elegant way, such as using a macro to simplify this code (reduce it to few lines):</p>
  
  <p>thanks.</p>