[Interest] qobject_cast

Igor Mironchik igor.mironchik at gmail.com
Thu Apr 20 18:35:15 CEST 2017


Hi,
  

>> QObject has virtual destructor... dynamic_cast will work. But it doesn't
>> matter, the problem was in another...
> If your class has virtual functions or derives from such base class, and have
> inline (or default) virtual destructor,its  v-table will be emitted in each
> translation unit. This is undesirable and can lead to subtle problems. See e.g.
>
> http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers

There said that it can lead just to increasing objects size in linking 
time. What problems may appear?



More information about the Interest mailing list