【发布时间】:2011-11-19 11:45:20
【问题描述】:
据说这段代码可以与 GCC 一起使用——我正在尝试让它与 Visual Studio 一起使用。我不知道代码是否真的有问题,或者我没有对端口做正确的事情。
1>c:\somepath\aaa.h(52): error C2101: '&' on constant
1> c:\somepath\aaa.h(52): while compiling class template member function 'const blahblah::Message something::AClass<Type>::aMethod(void) const'
1> with
1> [
1> Type=const lala::BClass&
1> ]
1> c:\somepath\bbb.h(79) : see reference to class template instantiation 'something:AClass<Type>' being compiled
1> with
1> [
1> Type=const lala::BClass&
1> ]
1> MyApplication.cpp
文件
aaa.h:52 virtual const Type aMethod() const { return Type(); }
bbb.h:79 AClass<const BClass&> blahblahblah_;
【问题讨论】:
-
这个可爱的小虫子。我喜欢它。
-
这是最新版本吗?似乎 VS2010 已经修改了这个错误信息。
-
好;它是在这里有点垃圾诊断。
-
嗯,刚启动VS2010,还是比较差。
标签: c++ templates visual-c++ compiler-errors