While debugging one of the program's core dump I came across the scenario where its contained object which is polymorphic loses its VPTr and I can see its pointing to NULL.
What could be the scenario when an object loses its VPTr.
Thanks in advance, Brijesh
virtual
function? even if it don't, there is little chance that the vptr will beNULL
as it is (often) used to store thetypeinfo
. – Filthtypeid
only works polymorphically if the class in question is polymorphic, i.e., it has at least one virtual function. That was defined this way exactly to avoid compilers having to include a vptr in every class. – Gytle