| 5 | 1/1 | 返回列表 |
| 查看: 760 | 回復(fù): 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) |
金蟲 (小有名氣)

金蟲 (小有名氣)

|
| 5 | 1/1 | 返回列表 |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
百度網(wǎng)盤 |
360云盤 |
千易網(wǎng)盤 |
華為網(wǎng)盤
在新窗口頁面中打開自己喜歡的網(wǎng)盤網(wǎng)站,將文件上傳后,然后將下載鏈接復(fù)制到帖子內(nèi)容中就可以了。 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 本人考085602 化學(xué)工程 專碩 +21 | 不知道叫什么! 2026-03-15 | 23/1150 |
|
|---|---|---|---|---|
|
[考研] 286求調(diào)劑 +10 | Faune 2026-03-21 | 10/500 |
|
|
[考研] 初試 317 +7 | 半拉月丙 2026-03-20 | 7/350 |
|
|
[考研] 0703化學(xué)調(diào)劑 +11 | 妮妮ninicgb 2026-03-15 | 15/750 |
|
|
[考研] 0703化學(xué)調(diào)劑 ,六級已過,有科研經(jīng)歷 +14 | 曦熙兮 2026-03-15 | 14/700 |
|
|
[基金申請]
學(xué)校已經(jīng)提交到NSFC,還能修改嗎?
40+4
|
babangida 2026-03-19 | 9/450 |
|
|
[考研] 265求調(diào)劑 +12 | 梁梁校校 2026-03-19 | 14/700 |
|
|
[考研] 機(jī)械專碩299求調(diào)劑至材料 +3 | kkcoco25 2026-03-16 | 4/200 |
|
|
[考研] 307求調(diào)劑 +10 | 冷笙123 2026-03-17 | 10/500 |
|
|
[考研] 一志愿南昌大學(xué),327分,材料與化工085600 +9 | Ncdx123456 2026-03-19 | 9/450 |
|
|
[考研]
|
然11 2026-03-19 | 4/200 |
|
|
[考研] 北科281學(xué)碩材料求調(diào)劑 +5 | tcxiaoxx 2026-03-20 | 5/250 |
|
|
[考研] 281求調(diào)劑(0805) +14 | 煙汐憶海 2026-03-16 | 25/1250 |
|
|
[考研] 085600材料與化工求調(diào)劑 +6 | 緒幸與子 2026-03-17 | 6/300 |
|
|
[考博] 26博士申請 +3 | 1042136743 2026-03-17 | 3/150 |
|
|
[考研] 材料工程專碩274一志愿211求調(diào)劑 +6 | 薛云鵬 2026-03-15 | 6/300 |
|
|
[論文投稿] 有沒有大佬發(fā)小論文能帶我個二作 +3 | 增銳漏人 2026-03-17 | 4/200 |
|
|
[考研]
|
zhouzhen654 2026-03-16 | 3/150 |
|
|
[考研] 一志愿211 0703方向310分求調(diào)劑 +3 | 努力奮斗112 2026-03-15 | 3/150 |
|
|
[考研] 070300化學(xué)學(xué)碩求調(diào)劑 +6 | 太想進(jìn)步了0608 2026-03-16 | 6/300 |
|