C ++多重继承的歧义

我正在尝试解决问题,但我被卡住了。

class A{
virtual vector<string> Get()=0;
}

class B: public virtual A{
virtual vector<string> Get(){ return {"something"};}
}

class c: public virtual A{
virtual vector<string> Get(){ return {"something else"};}
}

class d: public B, public C{
virtual vector<string> Get(){xxxxx}
}
ambiguous inheritance of 'std::vector<std::string,std::allocator<_Ty>> A:Get(void)'
override of virtual function "A:Get" is ambiguous

I have tried changing the return values so they return vector<string> but it still gives the same error.

评论