No matching function - c++
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:
re开发者_JAVA技巧turn RegMatrix(1,2,fill);
and it says I return (int,int,std::vector<ThreeDigits>&)
...
std::vector<double>
is not the same type as std::vector<ThreeDigits>
. You can fix this problem by either creating RegMatrix::RegMatrix(int, int, const std::vector<ThreeDigits>&)
, or by modifying the declaration of fill
: std::vector<double> fill;
.
精彩评论