討論串[語法] template 用法
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者littleshan (我要加入劍道社!)時間16年前 (2009/09/30 10:18), 編輯資訊
0
0
0
內容預覽:
這個東西,叫作 default argument. 也就是當你寫 test_limit<> 的時候. compiler 會幫你把 s_limit 代進去變成 test_limit<s_limit>. 如果你想限制只有某些 type 才能當作 template parameter. 常見的方法是 sp
(還有96個字)

推噓2(2推 0噓 4→)留言6則,0人參與, 最新作者POSIX (tedium of chores)時間16年前 (2009/09/30 06:47), 編輯資訊
0
0
0
內容預覽:
情況特殊 容我描述一下. 首先,. 猜測用法是當成namespace來用. 到時候餵給template當成參數用(達到限制參數的目的). struct s_limit {. typedef int iii;. typedef float fff;. };. 宣告一個dummy class. 宣告成t
(還有929個字)
首頁
上一頁
1
下一頁
尾頁