| 5 | 1/1 | 返回列表 |
| 查看: 763 | 回復(fù): 4 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||
[求助]
為何編不過?哪里錯(cuò)了?
|
||
|
#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; } 編輯錯(cuò)誤為: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) |
金蟲 (小有名氣)

金蟲 (小有名氣)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 286求調(diào)劑 +10 | Faune 2026-03-21 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 328求調(diào)劑,英語六級(jí)551,有科研經(jīng)歷 +5 | 生物工程調(diào)劑 2026-03-17 | 9/450 |
|
|
[考研] 材料工程專碩 348分求調(diào)劑 +3 | 冬辭. 2026-03-17 | 5/250 |
|
|
[考研] 297求調(diào)劑 +11 | 戲精丹丹丹 2026-03-17 | 12/600 |
|
|
[考研] 266求調(diào)劑 +3 | 哇呼哼呼哼 2026-03-20 | 3/150 |
|
|
[考研] 材料與化工(0856)304求 B區(qū) 調(diào)劑 +3 | 邱gl 2026-03-21 | 3/150 |
|
|
[考研] 求調(diào)劑 +3 | 白QF 2026-03-21 | 3/150 |
|
|
[考研] 085601調(diào)劑 358分 +3 | zzzzggh 2026-03-20 | 4/200 |
|
|
[考研] 307求調(diào)劑 +3 | wyyyqx 2026-03-17 | 3/150 |
|
|
[考研] 083200學(xué)碩321分一志愿暨南大學(xué)求調(diào)劑 +3 | innocenceF 2026-03-17 | 3/150 |
|
|
[考研] 295求調(diào)劑 +4 | 一志愿京區(qū)211 2026-03-18 | 6/300 |
|
|
[考研] 329求調(diào)劑 +9 | 想上學(xué)吖吖 2026-03-19 | 9/450 |
|
|
[考研] 289求調(diào)劑 +6 | 懷瑾握瑜l 2026-03-20 | 6/300 |
|
|
[考研] 319求調(diào)劑 +3 | 小力氣珂珂 2026-03-20 | 3/150 |
|
|
[考研] 環(huán)境工程調(diào)劑 +9 | 大可digkids 2026-03-16 | 9/450 |
|
|
[考研] 求調(diào)劑 +3 | 暗涌afhb 2026-03-16 | 3/150 |
|
|
[考研] 材料與化工求調(diào)劑 +7 | 為學(xué)666 2026-03-16 | 7/350 |
|
|
[考研] 275求調(diào)劑 +4 | 太陽花天天開心 2026-03-16 | 4/200 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風(fēng)就是雨; 2026-03-16 | 3/150 |
|
|
[考研] 0856求調(diào)劑 +3 | 劉夢(mèng)微 2026-03-15 | 3/150 |
|