class A {
public:
  virtual void op();

  ……

};

class B : public A {
public:
  void op(); // 在这个函数中会调用anotherOperator,但anotherOperator不是虚函数
  void anotherOp();
  ……
};

A
* a = new B;
a
->op();// OK

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2021-12-31
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-08
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案