Statically initializing a structure with arrays of varying length
<p>I've got a static map of identifier&lt;=>struct pairs, and each struct should contain some arrays. Everything is known at compile time. That is, I want to have something like this here:</p>

<pre><code>ID1 =&gt; name: someString
       flagCount: 3
       flags: [1, 5, 10]
</code></pre>

<p>statically created (if possible). Of course, a declaration like:</p>

<pre><code>struct Info
{
    const char* name;
    int flagCount;
    int flags[];
};
</code></pre>

<p>would be ideal, as long as I could initialize it like ...</p>

<pre><code>Info infos [] = { ... };
</code></pre>

<p>which is not possible, due to the varying length arrays (except I'm missing something). Alternatively, I though about (ab)using <code>boost::assign</code> for this, but I'm wondering if there is a recommended solution to this. I'm fine if I can store only the info structures into an array, and to the mapping elsewhere.</p>

<p>Edit: A note on the current solution. At the moment, I have:</p>

<pre><code>struct Info
{
    Info (const std::vector&lt;int&gt;&amp; flags) : flags {}
    std::vector&lt;int&gt; flags;
};
</code></pre>

<p>and I use:</p>

<pre><code>const std::map&lt;ID, Info&gt; map = boost::assign::map_list_of
    ("ID1", Info (boost::assign::list_of (1)(2)(3));
</code></pre>

<p>which works, I'm just curious whether there is a simpler solution (template-based?).</p>
