开发者

VC++ Error on template inheritance

开发者 https://www.devze.com 2022-12-11 07:39 出处:网络
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:

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

精彩评论

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