作者godman362 (Shizuru)
看板NUU_CSIE
標題[發問] 快一個人來解決我的問題
時間Sun Mar 8 12:32:43 2009
template <class T, class U>
和
template <class T>
template <class U>
差別在哪裡ˊˋ
為什麼這樣寫可以過:
template <class T, class U>
void show(T a, U b)
{
...
...
}
這樣寫就不能過:
template <class T>
template <class U>
void show(T a, U b)
{
...
...
}
哭哭
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.118.49.83
1F:→ tuzr:小聲說:我不會template,跟enum...(哭著跑開...) 03/08 12:59
2F:→ godman362:enum我也只有知道...但是實際用起來還沒試過 03/08 13:10
3F:→ godman362:我急著要答案啦 囧 沒有找到類似的資料啦 機車 03/08 13:10
4F:→ tuzr:我好奇,如果把下面的void show分兩個呢?一個T 一個U... 03/08 13:16
5F:→ godman362:你是說: show (T a, Tb) show (U a, U b)嗎 03/08 13:23
6F:→ godman362:沒救喔....compile不會給你過 03/08 13:23
7F:→ godman362:ㄋㄞ他都沒用,compile一點都不nice 03/08 13:23