调用模板化函数时出错

时间:2013-11-28 09:22:15

标签: c++

我有两个类,比如

class DetectedObject_OF_Kalman{} and 

template <class D, class M>
class Match{ }

然后我有模板化的功能,如

template <class D, class M>//D for DetectedObject, and M for Matched object
int find_matches (list<D*> &objects1, list<D*> &objects2, list<M*> &results, list<M*> &storage, list<D*> &unmatched1, list<D*> &unmatched2)

当我打电话给find_matches

int tracking(IplImage* fg_im)
{
    int ret_val = 0;
    list<DetectedObject_OF_Kalman*> DObjects;   
    list<DetectedObject_OF_Kalman*> TObjects;   
    list<DetectedObject_OF_Kalman*> unmatchedD;   
    list<DetectedObject_OF_Kalman*> unmatchedT;   
    list<Match<class D, class M>*> results;   
    list<Match<class D, class M>*> matchStorage;   
    list<DetectedObject_OF_Kalman *>::iterator iter;   
    list<DetectedObject_OF_Kalman*>::iterator iterFound;   
    list<Match<class D, class M>*>::iterator iterM; 

    findMatches<DetectedObject_OF_Kalman, Match>(DObjects, TObjects, results, matchStorage, unmatchedD, unmatchedT);

}

我得到findMatches的编译错误未定义。不允许DetectedObject_OF_Kalman。并且缺少类模板"Match"。 调用findMatches函数的正确方法是什么。

0 个答案:

没有答案