开发者

No matching function - c++

开发者 https://www.devze.com 2023-04-04 20:53 出处:网络
I have the following constructor: RegMatrix(int numRow, int numCol, std::vector<double> fill); and inside one of my functions:

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

精彩评论

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