我有两个类,比如
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
函数的正确方法是什么。