another c++ q (with specialization and inheritance )

another c++ q (with specialization and inheritance )

Oleg Goldshmidt pub at goldshmidt.org
Tue Apr 28 17:34:20 IDT 2009


Oleg Goldshmidt <pub at goldshmidt.org> writes:

>>         c2<int> gen_c2(int a)
>>         {
>>                 c2<int> ret(a);
>
> This is where you *instantiate* an object of type c2<int>, so you
> cannot specialize the template later, as the compiler tells you.

The compiler and Shachar... I was not attentive enough reading his
post, focused on the suggestion to return a pointer... He diagnosed
the problem perfectly, the solution is in my post.

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list