“function1”:重载函数仅因“function2”的返回类型而异
注解
重载的函数具有不同的返回类型,但有相同的参数列表。 每个重载的函数必须具有不同的形参列表。
示例:
以下示例生成 C2556:
// C2556.cpp
// compile with: /c
int func();
double func(); // C2556
int func(int i); // OK parameter lists differ
“function1”:重载函数仅因“function2”的返回类型而异
重载的函数具有不同的返回类型,但有相同的参数列表。 每个重载的函数必须具有不同的形参列表。
以下示例生成 C2556:
// C2556.cpp
// compile with: /c
int func();
double func(); // C2556
int func(int i); // OK parameter lists differ