Overload of pure virtual function

后端 未结 6 641
无人及你
无人及你 2021-01-12 23:45

I usually use pure virtual functions for those methods that are required by my code to work well. Therefore, I create interfaces and then other users implement their derived

6条回答
  •  灰色年华
    2021-01-12 23:59

    You can't.

    Suppose you have a Base pointer, pointing to a Derived object. Having the Base pointer, you have "access" only to the Base's interface (unless you cast to Derived pointer, but this is not what you need).

提交回复
热议问题