看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC++ 6.0 問題(Question): 請問如果是 template<size_t N> int test(int x1, ...) { 想告訴有 N 個 input, x1, ..., xN } 這樣是 OK 的 但如果某特定個數 input (例如 N = 3) 的 Specialization 請問要怎麼寫才好呢 (雖然想到一大堆替代方案...) 希望大家不吝指教 感恩 ※ 編輯: applecool 來自: 123.110.247.44 (03/20 00:12)
linotwo:google "variadic function" 03/20 00:55
loveme00835:caller 的 code 長怎樣 03/20 03:03
applecool:const int t = test<3>(1,2,3); 03/20 06:46
applecool:VC6 不能用 C++11 03/20 06:47
tinlans:這東西問世的時候我還未成年,現在我都變大叔了... 03/20 07:42
linotwo:http://ideone.com/f2XvSn 03/20 09:35
applecool:了解~~學到了~~~謝謝! 03/20 20:23
applecool:可是我想把參數個數改變就無法了,好像只能重載? 03/20 21:25
yoco315:vc6 真懷念.. 當初交了一個作業給教授.. 教授無法編譯.. 03/20 22:16
yoco315:因為他的 vc6 還沒 patch,所以吃不下我的程式碼.. 後來 03/20 22:17
yoco315:教授把我叫去「你確定你的程式碼是對的嗎?」「確定」 03/20 22:18
yoco315:「那就好,那我不用看了」就打分數了 XD 03/20 22:18
diabloevagto:有試著跑程式就不錯了,現在很多都人腦compiler評分 03/20 23:35