<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Erez D wrote:<br>
<blockquote
 cite="mid:6c32b540904280003t6b6cfbb8o546d4ecd2ab030b7@mail.gmail.com"
 type="cite">
  <div dir="ltr">        c2&lt;int&gt; gen_c2(int a)<br>
        {<br>
                c2&lt;int&gt; ret(a);<br>
                return ret;<br>
        }<br>
  </div>
</blockquote>
It would seem to me that this line instantiates c2&lt;int&gt;, so that<br>
<blockquote
 cite="mid:6c32b540904280003t6b6cfbb8o546d4ecd2ab030b7@mail.gmail.com"
 type="cite">
  <div dir="ltr">template &lt;&gt; class c2&lt;int&gt; : public
c1&lt;int&gt;<br>
{<br>
public:<br>
        c2(int &amp;a):c1(a) {};<br>
};<br>
  <br>
  </div>
</blockquote>
is an attempt to specialized a class that has already been instantiated
from the generic template. The compiler has no way to go back and
change the storage size for c2&lt;int&gt;, which it already needed to
know when compiling the lines above.<br>
<br>
Try to have gen_c2 return a pointer to c2&lt;int&gt;. That may resolve
the problem.<br>
<br>
Shachar<br>
<pre class="moz-signature" cols="72">-- 
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>