【发布时间】:2016-11-23 10:54:57
【问题描述】:
#include<iostream>
class Test {
static void fun() {}
void fun() {} // compiler error
};
int main()
{
getchar();
return 0;
}
输出:
|4|错误:‘void Test::fun()’不能重载|
【问题讨论】:
-
所以,从删除 C 标签开始...
-
为您自己的 C++ 编译器提供此功能。我们可以称之为替代方案。
标签: c++ oop static function-declaration