[問題] hw1.2.p2c

看板EE_DSnP作者 (ray)時間15年前 (2009/03/18 14:55), 編輯推噓1(102)
留言3則, 3人參與, 最新討論串1/1
template <class T> void selectionSort(vector<T>& array, const Compare<T>& compare) { ... } int main() { vector<string> userInput_1(i); ... selectionSort( userInput_1, Less() ); ... } compile 時就出現error: missing template arguments before 「(」 token 請問這是哪裡出問題了呢....? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.224.46.41

03/18 14:58, , 1F
有個地方要指明 <string>,找找看吧
03/18 14:58, 1F

03/18 15:22, , 2F
是指selectionSort<string> ()嗎??可是加了還是一樣...
03/18 15:22, 2F

03/18 15:39, , 3F
Less<string>() <- 你要指明哪一種樣本的Less
03/18 15:39, 3F
文章代碼(AID): #19m9hhD9 (EE_DSnP)