mar*_*hon 5 c++ templates compiler-errors visual-c++
这个代码应该适用于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
Run Code Online (Sandbox Code Playgroud)
档
aaa.h:52 virtual const Type aMethod() const { return Type(); }
bbb.h:79 AClass<const BClass&> blahblahblah_;
Run Code Online (Sandbox Code Playgroud)