C++ private and protected virtual method

后端 未结 3 1364

It seems that it is good to make the virtual methods private in order to separate the interfaces for following two clients - 1. clients that instantiate an object and call the

3条回答
  •  遥遥无期
    2021-02-08 22:41

    Yes, if you need to call the SaveData of another class, it needs to be accessible from that class - so public or protected.

提交回复
热议问题