开发者

VC++ Error on template inheritance

This is child's play, but I'm a bit of a vc n00b.

I get an error: error C2143: syntax error : missing ',' before '<'. on the second line of the following code:

te开发者_开发百科mplate<int i, int j> 
class B : public A<i, j> { }

template<int i, int j> 
class A { }

Thanks for the help!


You forgot the semi-colons and the declaration of A(just declare A before B to avoid writing the declaration):

template<int i, int j> 
class A { };

template<int i, int j> 
class B : public A<i, j> { };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜