double のベクトルが次のように格納されるクラスがあります。
class clsHalfphoneUnitJoinFeatures : public CBaseStructure
{
private:
vector<double> m_content;
protected:
virtual void ProcessTxtLine(string line);
public:
vector<double> &Content();
void Add(vector<double> &jf);
};
ただし、double の新しいベクトルを追加したい場合は、機能しません。
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 を変換できません
誰かが私がどこで間違ったのか教えてもらえますか?
ありがとうございました!