Are references and pointers equal with regards to polymorphism?

前端 未结 3 717
南笙
南笙 2020-12-08 10:05

I always think of having to use pointers for polymorphism. Using the canonical example:

DrawEngine::render(Shape *shape)
{
    shape->draw();
    shape-&g         


        
3条回答
提交回复
热议问题