title: How to unroll a short loop in C++
body: <p>I wonder how to get something like this:</p>
  
  <ol>
  <li><p>Write</p>
  
  <pre><code>copy(a, b, 2, 3)
  </code></pre></li>
  <li><p>And then get</p>
  
  <pre><code>a[2] = b[2];
  a[3] = b[3];
  a[4] = b[4];
  </code></pre></li>
  </ol>
  
  <p>I know that C #defines can't be used recursively to get that effect. But I'm using C++, so I suppose that template meta-programming might be appropriate.</p>
  
  <p>I know there is a <a href="http://en.wikipedia.org/wiki/Boost_%28C%2B%2B_libraries%29" rel="noreferrer">Boost</a> library for that, but I only want that "simple" trick, and Boost is too "messy".</p>