討論串[問題] template class 內 static 初始問題
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 5→)留言6則,0人參與, 7年前最新作者sarafciel (Cattuz)時間7年前 (2018/06/23 00:17), 7年前編輯資訊
0
0
2
內容預覽:
先釐清兩件事:. 1.你沒給定型態的template它就不是明確定義,自然它也不會被編譯。. 2.template在兩份不同的.cpp檔裡給定型態,會在編譯時各自生成兩份實作。. 回到你的code上面,當你使用extern template的時候. 代表你指定在編譯時這份cpp檔參考其他cpp或.o
(還有873個字)

推噓3(3推 0噓 18→)留言21則,0人參與, 7年前最新作者lovejomi (JOMI)時間7年前 (2018/06/22 17:03), 7年前編輯資訊
0
0
2
內容預覽:
https://wandbox.org/permlink/skxmougiYnaw1f1a. 一開始遭遇到這個compile warning. warning: instantiation of variable 'Foo<int>::bar' required here, but no defin
(還有908個字)
首頁
上一頁
1
下一頁
尾頁