Aren't the template instances generated at the place of the template?<div>The external code would instantiate the template, adding the instance information to the structure.</div><div>Then the sizeof would just read the set of instantiated templates.</div>
<div>This wouldn't require knowing about the code which instantiates the template.</div><div>The only requirement would be to compute the size of the structure AFTER all template instances are generated.</div><div>The only limitation would be that separate compilation passes could generate different structures due to different template instances, but that's not a problem, because the static templates go through the same limitation.</div>
<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 1:11 PM, Timon Gehr <span dir="ltr"><<a href="mailto:timon.gehr@gmx.ch" target="_blank">timon.gehr@gmx.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12/05/2012 10:06 AM, Gor Gyolchanyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
...<div class="im"><br>
<br>
Is there any good reason why this feature wouldn't be a good idea?<br></div>
...<br>
</blockquote>
<br>
Determining the size of a struct instance would require knowledge about all the code that uses the struct declaration.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>