When using dynamic cast to do upcast, it is a kind of run-time or compile-time process?

93 Views Asked by At

I'm currently trying to figure out the performance of dynamic cast.

I know dynamic cast need inheritance relationship between two classes and need virtual function(need RTTI).

So it means I know use dynamic cast to do downcast is a run-time process because need to check RTTI info.

So what about upcast? It has same function with static cast. But I want to know if use dynamic cast to do some upcast, it will be a run-time process or compile-time process?

0

There are 0 best solutions below