I have the following constructor:
RegMatrix(int numRow, int numCol, std::vector<double> fill);
and inside one of my functions:
RegMatrix RegMatrix::operator+(RegMatrix &matrix)
I create:
std::vector<ThreeDigits> fill;
and then I return:
return RegMatrix(1,2,fill);
and it says I return (int,int,std::vector<ThreeDigits>&) …
Why is that and how can I fix it?
std::vector<double>is not the same type asstd::vector<ThreeDigits>. You can fix this problem by either creatingRegMatrix::RegMatrix(int, int, const std::vector<ThreeDigits>&), or by modifying the declaration offill:std::vector<double> fill;.