[問題] static函數無法用template嗎

作者: su27 (su27)   2020-02-27 15:41:48
開發平台(Platform): (Ex: Win10, Linux, ...)
win10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
vs2017
問題一
程式碼如下
我寫一個類別 其中一個函數使用靜態函數 功能正常
後來加入 template<class typeA> 編譯時會顯示"無法解析的外部符號...."
請問這有解嗎
該怎麼改才能編譯成功
謝謝
class Operator_Class_Func
{
public:
template<class typeA>
static int Get_Region_(Mat & src_image, Mat & dest_image, vector<Point> & vtp);
};
作者: sarafciel (Cattuz)   2020-02-27 15:54:00
你把函式定義拆到header外面去了吧?
作者: Jockey66666 (往事已成追憶)   2020-02-28 00:05:00
你知道你想做什麼嗎
作者: suspect1   2020-03-02 18:22:00
你知道c++的static含義嗎?

Links booklink

Contact Us: admin [ a t ] ucptt.com