\#include "stdafx.h"\
\#include \<iostream\>\
using namespace std;\
\
class Base1{\
public:\
void fun(){ cout \<\< "Base1\\n"; }\
\
};\
\
class Base2{\
private:\
bool fun(){ cout \<\< "Base2\\n"; return true; }\
\
};\
class C : public Base1, public Base2{\
\
};\
int main(){\
C c;\
c.fun();\
}\
/\*\
\
1\>main.cpp(21): error C2385: 对“fun”的访问不明确\
1\> 可能是“fun”(位于基“Base1”中)\
1\> 也可能是“fun”(位于基“Base2”中)\
1\>main.cpp(21): error C3861: “fun”: 找不到标识符\
1\>
可见,即使是私有继承,重载的识别方式只是从父类中取出所有函数,不论是否私有共有.
\
\*/