Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!samsung!munnari.oz.au!metro!ipso!runxtsa!tom From: tom@runxtsa.runx.oz.au (Thomas Antalffy) Newsgroups: comp.lang.c++ Subject: vtbl for abstract class : WHY ? Keywords: abstract class, vtbl Message-ID: <2206@runxtsa.runx.oz.au> Date: 30 Aug 90 01:11:53 GMT Organization: RUNX Unix Timeshare. Sydney, Australia. Lines: 23 When I make a class abstract by assigning 0 to one of its virtual methods, my C++ compiler generates a virtual function table and puts the address of char __pure_virtual_called() in the appropriate slot. This later creates a link error, because there is no default implementation of this function. I assume that this mechanism is there to give you the chance of putting error handling in __pure_virtual_called(). What puzzles me is that my compiler (Glockenspiel 2.0c) gives an error message if a derived class of an abstract class does not redefine the method. I.e. the compiler guarantees that methods of abstract classes are implemented in all derived classes, so it will never have to call the abstract class's method. In fact, I do not see why it needs a virtual function table for an abstract class at all. Does anyone know the answer to any of these questions ? Regards, Thomas.