class B
{
void Fb(){...};
};
class CA : virtual public B
{
void Fca(){...};
};
class CB : virtual public B
{
void Fcb(){...};
};
class CS: public CA, public CB
{
Fb();
};
B
----
CA
----
CB
----
CS
Err:
class B
{
public:
void Fb()
{
printf("Fbfffffffffffffffffffffffffffffffffffffffffffffffff");
}
};
class CA : public B
{
};
class CB : public B
{
};
class CS: public CA, public CB
{
public:
void Do()
{
Fb();
}
};
int _tmain(int argc, _TCHAR* argv[])
{
CS c;
c.Do();
return 0;
}
//////////////////////////////////////////////////////
1>f:\project\rreg\tt\tt.cpp(28) : error C2385: ambiguous access of 'Fb'
1> could be the 'Fb' in base 'B'
1> or could be the 'Fb' in base 'B'
1>f:\project\rreg\tt\tt.cpp(28) : error C3861: 'Fb': identifier not found
没有评论:
发表评论