ommitting vtables

Allan Sandfeld Jensen kde-optimize@mail.kde.org
Mon, 13 Jan 2003 09:35:13 +0100


On Monday 13 January 2003 01:14, Harri Porten wrote:
> On Mon, 13 Jan 2003, Dirk Mueller wrote:
> > On Son, 12 Jan 2003, Harri Porten wrote:
> > > I just remembered a MSVC extension (__declspec(novtable)) that stops
> > > the compiler from generating code for a class' vtable. Useful for
> > > abstract classes like interfaces.
> >
> > But when those interface classes get an implementation, you'll need a
> > vtable for them ?!
>
> Yes. The attribute only affects the base class. The vtable itself may
> still be emitted but there'll be no initialization code in the class's
> constructor. Also, the linker can drop the vtable w/o any reference.
>
Dont you think that happens if you make the class pure virtual?

`Allan