Does it make any sense to define “pure” virtual functions in the base class itself?

后端 未结 4 879
悲&欢浪女
悲&欢浪女 2021-02-07 15:38

The benefit of defining common virtual functions in the base class is that we don\'t have to redefine them in the derived classes then.

Even if we def

4条回答
  •  庸人自扰
    2021-02-07 16:12

    It can be beneficial when there is no reasonable implementation of pure virtual function can be in base class. In this case pure virtual functions are implemented in derived classes.

提交回复
热议问题