3 ms·
Technically virtual guarantees dynamic dispatch (i.e. calls through the base type will resolve to the derived function object). The dispatch can still be resolv
by gpderetta 5y ago
Technically virtual guarantees dynamic dispatch (i.e. calls through the base type will resolve to the derived function object). The dispatch can still be resolved at compile time of course.
A compiler could legally remove the vpntr if not necessary. In practice this only happens for purely local objects as current compilers do not implement the necessary interprocedural data layout transformation.