我有一个子类,它派生自两个父类(一个公共,一个私有)。每个父类都有一个重载 operator* 的函数。如果我在子类中使用这个函数,我会得到一个错误(不明确的函数),但是我想使用公共父类的方法。
class ParentA
{
public:
ParentA operator*(const ParentA & other);
};
class ParentB
{
public:
ParentB operator*(const ParentB & other);
};
class Child : public ParentA, private ParentB
{
...
};
int main()
{
Child x,y;
x*y;
return 0;
}
我该如何解决这个问题?
非常感谢,雷莫