Converting Derived** to Base** and Derived* to Base*

前端 未结 6 830

Ok, I was reading through this entry in the FQA dealing about the issue of converting a Derived** to a Base** and why it is forbidden, and I got th

6条回答
  •  离开以前
    2020-12-10 20:32

    Well the code you gave makes sense. Indeed the assignement operator cannot overrite data specific to Derived but only base. Virtual functions are still from Derived and not from Base.

提交回复
热议问题