我有一个类,其中双打向量存储如下:
class clsHalfphoneUnitJoinFeatures : public CBaseStructure
{
private:
vector<double> m_content;
protected:
virtual void ProcessTxtLine(string line);
public:
vector<double> &Content();
void Add(vector<double> &jf);
};
但是,当我想添加一个新的双打向量时,它不起作用:
void clsHalfphoneUnitJoinFeatures::ProcessTxtLine(string line)
{
line = CompactLine(line);
if (line == "")
return;
int b = 0;
int n = line.find("\t");
string s = "";
int idx = 0;
vector<double>jf;
jf.resize(16);
int i = 0;
for(;;)
{
if (n == -1)//if this is the last item in this line
{
s = line.substr(b,line.length()-b);
jf[i++] = atof(s.c_str());
break;
}
s = line.substr(b,n-b);
jf[i++] = atof(s.c_str());
b = n+1;
n = line.find("\t",b);
}
m_content.push_back(jf);
}
我得到的错误是
m_content.push_back(jf);
错误 C2664:“void std::vector<_Ty>::push_back(_Ty &&)”:无法在“double &&”中从“std::vector<_Ty>”转换参数 1
有人能告诉我哪里出错了吗?
谢谢!