开发者

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>&) ...

Why is that and how can I fix it?


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;.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜