What&#x27;s the equivalent pattern in C++ to do this then? Specifically a contiguously allocated but variable length struct. I was thinking you can use template:<p><pre><code>    template &lt;int N&gt;
    struct ion_system_heap {
        struct ion_heap heap;
        struct ion_page_pool *pools[N];
    };
</code></pre>
But that is not quite the same thing since ion_system_heap&lt;10&gt; and ion_system_heap&lt;20&gt; won&#x27;t be the same type and makes it super hard to use. And a whole bunch of other problems like not knowing how many pages you want to allocate at compile time.<p>Yes you can just use a vector for &quot;pools&quot; but that allocates it on the heap instead of in the struct.