Referring to a base class with template template parameters

Deth alexrepair@gmail.com
Sun Nov 8 19:24:00 GMT 2009


Perfect!  That's exactly what I was looking for.  All of my "<B>" text
was turned into HTML bold tags, so the code in my original post (and the
pre-edit follow-up) was garbage.  Sorry for the confusion!

-Alex


Ian Lance Taylor-3 wrote:
> 
> 
> B refers to the instantiated class B<>, not the template B.  So you
> need to qualify it.  Is this code what you are after?
> 
> template <template <typename> class T>
> class A {
> public:
>    A(int) {}
> };
> 
> template <typename>
> class B : public A<B> {
> public:
>    B(int i)
>      : A< ::B>(i) {}
> };
> 
> (note the space required between "<" and "::" to avoid a digraph).
> 
> 

-- 
View this message in context: http://old.nabble.com/Referring-to-a-base-class-with-template-template-parameters-tp26249699p26256986.html
Sent from the gcc - Help mailing list archive at Nabble.com.



More information about the Gcc-help mailing list