[問題] Nested Class Template

看板C_and_CPP (C/C++)作者 (XD)時間13年前 (2012/06/30 15:27), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) g++ 4.4.4 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) None 問題(Question): (見下面程式碼) 我想在Class CA裡面加個Class CB 而這個CB會用到CA部分的Template(這個例子裡面是B) 想請問一下要怎麼寫才是正確的 Google了很多關於nested class template可是都是CA和CB使用不同的Template 謝謝 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): test.cpp:12: error: invalid explicit specialization before '>' token test.cpp:12: error: enclosing class templates are not explicitly specialized test.cpp:13: error: template parameters not used in partial specialization: test.cpp:13: error: 'A' 程式碼(Code):(請善用置底文網頁, 記得排版) http://pastebin.com/TAmVLCL4 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.42.223.165

06/30 15:36, , 1F
自問自答..我想太多了..http://pastebin.com/kytm31YA
06/30 15:36, 1F
文章代碼(AID): #1FxgfA9_ (C_and_CPP)
文章代碼(AID): #1FxgfA9_ (C_and_CPP)