[問題] parameter 是 template function pointer

看板C_and_CPP (C/C++)作者時間15年前 (2010/08/06 19:15), 編輯推噓0(006)
留言6則, 2人參與, 最新討論串1/3 (看更多)
不好意思請問一下 我想要做到的功能是 某一個函式中的其中一個參數是 template function pointer template <class T> class Transmitter{ public: Transmitter(T* source); template <class T> //error void addInvoction(string command,void T::*(string) method); } 在上面那行會compile不過 但我卻不知如何改 template又不能進行 typedef 請問這個有解嗎??? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.36.50.5

08/06 19:22, , 1F
pointer to function template ?
08/06 19:22, 1F

08/06 19:47, , 2F
能不能描述清楚一點?看不是很懂你的語意想要做啥..
08/06 19:47, 2F

08/06 19:49, , 3F
因為不知道你要的是一般函式還是成員函式, 我寫了個成
08/06 19:49, 3F

08/06 19:50, , 4F
員函式版的小程式, http://tinyurl.com/236megb 這個
08/06 19:50, 4F

08/06 19:51, , 5F
對語法熟悉一點應該可以直接從一般類別改寫成模版才對
08/06 19:51, 5F

08/06 19:53, , 6F
還有在說型態的時候請正名一下, 不然都看不懂= =
08/06 19:53, 6F
文章代碼(AID): #1CM-xCQH (C_and_CPP)
文章代碼(AID): #1CM-xCQH (C_and_CPP)