"Christopher C. Stacy" <[EMAIL PROTECTED]> writes:

> If I have classes A and B both with members named FOO, 
> and class C based on those two, what happens?
> What if it's a function FOO?

Such a situation is not an error in itself, but since a reference to
such a member is ambiguous, you'll have to specify which one you mean
when using it.

For example:

struct A { int a; };
struct B { int a; };
struct C : A, B { int c; };

int main() 
{
   C c;
   int x = c.a;         // Error, ambiguous
   int y = c.A::a;      // OK
   return 0;
}

Likewise for function members.


Reply via email to