|
|
|
|
|
by ryao
300 days ago
|
|
The vtable pointer corresponds to the actual type in languages that use vtables to implement inheritance, so you do know the type. Read my previous comment for the bug that would happen if what us being used in Linux were actually used for dynamic dispatch when implementing inheritance, and it should be clear this is something similar, but different. |
|
> Read my previous comment for the bug
No this is not a bug. The entire point of inheritance or dynamic dispatch IS that you call a function from "a different class" aka the subclass the object is an instance of. This is not a bug, this is the entire point of implementing it with vtables.