用VS2008编译泛型出错,vs2005却通过

sorryIdonotknow sorryIdonotknow 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
下面代码在VS2008出错,在VS2005却通过,对比过编译选项,两者差不多的

template<bool b>
class CTestTemplate
{
public:
struct STypeInClass{};

static STypeInClass* pp ;
};

template<bool b>
typename CTestTemplate<b>::STypeInClass* CTestTemplate<b>::pp = NULL ;

提示出错是这段代码: typename CTestTemplate<b>::STypeInClass* CTestTemplate<b>::pp = NULL ;
error C2143: syntax error : missing ';' before '*'
...全文

相关推荐

评论 8
收藏 已收藏
分享
返回顶部
sorryIdonotknow
C++ 语言 65,214 成员 250,514 内容