Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
'type' : ambiguous base class
Remarks
The compiler could not unambiguously resolve a function call because the function exists in more than one base class.
To resolve this error, either remove one of the base classes from the inheritance, or explicitly qualify the function call.
Example
The following example generates C2387:
// C2387.cpp
namespace N1 {
struct B {
virtual void f() {
}
};
}
namespace N2 {
struct B {
virtual void f() {
}
};
}
struct D : N1::B, N2::B {
virtual void f() {
B::f(); // C2387
// try the following line instead
// N1::B::f();
}
};
int main() {
D aD;
aD.f();
}