vs2005上的模板问题 [英] Template issue on vs2005

查看:74
本文介绍了vs2005上的模板问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我将我的一些代码从vc6转移到了vs2005,我遇到了模板问题.代码看起来像这样.

Today I transferred some of my code from vc6 to vs2005 and I encountered a problem with the template. The code looks like this.

 template<BOOL b>
 class CL
 {
    public:
        enum etype{ come=0, go, present };
        etype checkType( int iType );
 }

 template<BOOL b>
 CL<b>::etype CL<b>::checkType( int iType )
{
  if( iType ){
  ...
  }
  ...
  return CL<b>::etype(iType);
}



对于vc6,一切都很好,但是vs2005的返回类型有问题.
我该怎么解决?



For vc6 everything is fine but vs2005 there is a problem on return type.
How can I solve it?

推荐答案

您确定不是由于类定义末尾缺少分号引起的吗?
Are you sure it is not due to the missing semi-colon at the end of your class definition?


这篇关于vs2005上的模板问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆