[問題] Nested Class Template
開發平台(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
06/30 15:36, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章