In article <xv*************@Psilocybe.Update.UU.SE>,
jo****@Student.DoCS.UU.SE says...
[ ... ]
Unless you are working under SEVERE memory constraints (e.g. in an embedded
system) this is a non-issue since there is only one vtbl per class with
virtual functions.
Any virtual function also (typically) means that each object has to
carry a pointer to the vtable. In some cases that's simply
unacceptable -- consider (for example) building a text editor, and
wrapping each character in a class. The total size of the class sans
virtual dtor is typically 8 bits. On a 64-bit system, the vtable
pointer would increase that to 72 bits, and that might easily cause
padding to be added, so the total size goes up to 128 bits.
Mulitply that overhead by the number of characters in a text file,
and you've got a text editor almost as efficient as emacs on an 8-bit
microcontroller.
--
Later,
Jerry.
The universe is a figment of its own imagination.