class Polinom {
public:
std::vector<double> vect;
Polinom operator +(const Polinom &that) {
if (this->vect.size() > that.vect.size()) {
for (int i = that.vect.size(); i < this->vect.size(); i++)
that.vect.push_back(0);//here
}
else if (that.vect.size() > this->vect.size()) {
for (int i = this->vect.size(); i < that.vect.size(); i++)
this->vect.push_back(0);
}
std::vector<double> sum;
std::vector<double>::iterator i2 = that.vect.begin();//here
for (std::vector<double>::iterator i1 = this->vect.begin(); i1 != this->vect.end(); ++i1)
sum.push_back(*i2++ + *i1);
return sum;
}
Polinom();
Polinom(std::vector<double> vect) {
this->vect = vect;
}
~Polinom();
};
Run Code Online (Sandbox Code Playgroud)
严重性代码说明项目文件行抑制状态错误(活动)E1087没有重载函数“ std :: vector …