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

后端 未结 4 867
悲&欢浪女
悲&欢浪女 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:14

    A base-class with only pure virtual functions are what languages like Java would call an interface. It simply describes what functions are available, nothing else.

提交回复
热议问题