title: Wrapper macro for a generated static array
body: <p>I'm working on generating some large static meta data structures right now, and would like to optimize the size of some the generated c++ files.</p>
  
  <pre><code>static constexpr MetaData* metaDataArray[] = {
    &amp;MetaDataObject0,
    &amp;MetaDataObject1,
    &amp;MetaDataObject2,
    &amp;MetaDataObject3,
    &amp;MetaDataObject4,
    &amp;MetaDataObject5,
    &amp;MetaDataObject6,
    &amp;MetaDataObject7,
    &amp;MetaDataObject8,
    &amp;MetaDataObject9,
    &amp;MetaDataObject10,
    &amp;MetaDataObject11,
    &amp;MetaDataObject12,
    &amp;MetaDataObject13,
    &amp;MetaDataObject14,
    &amp;MetaDataObject15,
    &amp;MetaDataObject16,
    &amp;MetaDataObject17,
    &amp;MetaDataObject18,
    &amp;MetaDataObject19,
    &amp;MetaDataObject20
  }
  </code></pre>
  
  <p>This is an example of an array that I would like to wrap into a macro. Preferrably something like this:</p>
  
  <pre><code>METADATA_ARRAY(MetaDataObject,20);
  </code></pre>
  
  <p>I realize this is probably quite tricky. I haven't really found a solution this problem yet, maybe it's not even possible to create a recursive macro that expands while keeping an index counter variable?</p>
  
  <p>Maybe it's more feasible to aim for a macro more along these lines:</p>
  
  <pre><code>METADATA_ARRAY(MetaDataObject,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
  </code></pre>
  
  <p>I have found some references to variadic macros like this (along these 
  lines: <a href="https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s" rel="nofollow">https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s</a>).</p>
  
  <p>This approach seems to be limited to 64 arguments though. Some of the arrays in our generated code have 3000+ elements. Is this possible to work around with some creative preprocessor black magic?</p>