what's polymorphic type in C++?

前端 未结 5 1267
猫巷女王i
猫巷女王i 2021-02-01 14:56

I found in one article saying \"static_cast is used for non-polymorphic type casting and dynamic_cast is used for polymorphic type casting\". I understand that int and double ar

5条回答
  •  猫巷女王i
    2021-02-01 15:33

    I think that we always define/declare the destructor of any class as virtual especially in an inheritance tree. Then we can say that almost all classes in an inheritance tree are polymorphic.

提交回复
热议问题