Visual Studio Compiler warning C4250 ('class1' : inherits 'class2::member' via dominance)

前端 未结 5 2096
梦毁少年i
梦毁少年i 2020-12-10 04:59

The following code generates warning C4250. My question is, what\'s the best solution to it?

class A
{
  virtual void func1();
}

class B : public A
{
}

cla         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 05:24

    I think the solution you're using may be the way to go, sorry to say. The only thing I can think of that might help is if you're able to make A's func1 pure virtual. That might not be feasible in your real program, though.

提交回复
热议问题