且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调用模板函数时的编译器错误

更新时间:2023-11-10 17:01:04

as:


void getData(Vector& amp; amp;)

void getData(Vector&, int&)


b $ b

您的呼叫方式如下:

You are calling it as:


getData();

getData();

很明显,编译器找不到没有参数的函数,因此找不到没有mathching函数错误。

Clearly, the compiler cannot find the function which takes no parameteres and hence the no mathching function error.

computeSum()的情况也是如此。

的其他错误,以及成功是两个变量,在 main ,但未在中的任何位置声明。

There are a host of other errors as well like success and total are two variables which are being accessed in main but not declared anywhere inside the main.