| 查看: 723 | 回复: 4 | ||
[求助]
为何编不过?哪里错了?
|
|
#include template template class CSampleTemplate { private: T t1; T2 t2; public: CSampleTemplace(T arg1, T2 arg2) { t1=arg1+num; t2=arg2+num; } void Write() { std::cout<<"t1:"< ~ CSampleTemmplate(void){} }; int main(int argc, char* argv[]) { CSampleTemplate temp.Write(); return 0; } 编辑错误为:ug-------------------- Compiling... 11.cpp E:\1\11.cpp(2) : error C2991: redefinition of template parameter '__formal' E:\1\11.cpp(2) : see declaration of '__formal' E:\1\11.cpp(2) : error C2059: syntax error : 'constant' E:\1\11.cpp(2) : error C2501: 'demol' : missing storage-class or type specifiers E:\1\11.cpp(14) : warning C4183: 'CSampleTemplace': member function definition looks like a ctor, but name does not match enclosing class E:\1\11.cpp(20) : see reference to class template instantiation 'CSampleTemplate E:\1\11.cpp(19) : error C2523: 'CSampleTemplate E:\1\11.cpp(20) : see reference to class template instantiation 'CSampleTemplate E:\1\11.cpp(11) : warning C4183: 'CSampleTemplace': member function definition looks like a ctor, but name does not match enclosing class E:\1\11.cpp(23) : see reference to class template instantiation 'CSampleTemplate E:\1\11.cpp(19) : error C2523: 'CSampleTemplate E:\1\11.cpp(23) : see reference to class template instantiation 'CSampleTemplate E:\1\11.cpp(23) : error C2661: 'CSampleTemplate Error executing cl.exe. 11.obj - 6 error(s), 2 warning(s) |
» 猜你喜欢
有时候真觉得大城市人没有县城人甚至个体户幸福
已经有10人回复
天津大学招2026.09的博士生,欢迎大家推荐交流(博导是本人)
已经有5人回复
有院领导为了换新车,用横向课题经费买了俩车
已经有5人回复
CSC & MSCA 博洛尼亚大学能源材料课题组博士/博士后招生|MSCA经费充足、排名优
已经有6人回复
同年申请2项不同项目,第1个项目里不写第2个项目的信息,可以吗
已经有3人回复
面上项目申报
已经有3人回复
酰胺脱乙酰基
已经有9人回复
博士延得我,科研能力直往上蹿
已经有7人回复
面上基金申报没有其他的参与者成吗
已经有5人回复
遇见不省心的家人很难过
已经有22人回复
» 本主题相关价值贴推荐,对您同样有帮助:
《化学学报》投稿模板编辑出错
已经有3人回复
C++编程,关于循环结构的,大家看看我这程序哪里错了?
已经有21人回复
要是已经发表的SCI论文发现有重大的错误怎么办?错误是编辑造成的不死我造成的
已经有5人回复
原来编译的siesta突然不能用,重新编译没错,运行出错
已经有13人回复
编译vasp出错
已经有11人回复
【求助】f90子程序怎么编译错误?请大家帮忙,谢谢
已经有3人回复
投稿两天发现稿子有个错误,编辑也指出来了,怎么办?
已经有21人回复
编辑发错审稿意见,但文章无进展,如何处理
已经有9人回复
编辑发错审稿意见了如何写信询问
已经有15人回复
编辑来信,我把来信翻译了 大家帮看看哪有错误?
已经有15人回复
【求助】SAS编程出了错,看不懂,请教高手
已经有8人回复
caoyjian
金虫 (小有名气)
- 应助: 1 (幼儿园)
- 金币: 2047.2
- 帖子: 181
- 在线: 68.8小时
- 虫号: 1677947
- 注册: 2012-03-09
- 性别: GG
- 专业: 信号理论与信号处理

2楼2012-06-20 11:15:08
caoyjian
金虫 (小有名气)
- 应助: 1 (幼儿园)
- 金币: 2047.2
- 帖子: 181
- 在线: 68.8小时
- 虫号: 1677947
- 注册: 2012-03-09
- 性别: GG
- 专业: 信号理论与信号处理

3楼2012-06-20 11:43:58
|
4楼2012-06-20 12:16:21
5楼2012-06-21 08:51:19













回复此楼