我有一个模板类的成员函数,声明如下:
template <class T>
int Data<T>::getPosition(vector<T> stuff, T newStuff, bool ascending)
我用这条线在某处称它为
frequencies.insert(frequencies.begin() + getPosition(frequencies, current, ascending),
frequencies[i]);
该行的变量声明为:
vector<T> temp;
vector<int> frequencies;
int current = frequency.find(words[i])->second;
但是,调用会getPosition
给出此错误:
Data.h|158|error: no matching function for call to 'primitives::Data<double>::getPosition(std::vector<int, std::allocator<int> >&, int&, bool&)'|
Data.h|165|note: candidates are: int primitives::Data<T>::getPosition(std::vector<T, std::allocator<_CharT> >, T, bool) [with T = double]|
我在这里做错了什么?