al*****@gmail.com wrote:
This is OT but since this is the c++ hangout someone might know how
this is implemented in c++ compilers. What happens when you declare a
function pure virtual in the vptr/vtable system: does the "= 0" mean
that the function pointer itself is set to 0?
If you provide an implementation for the function, it points to that.
If you do not, it points to whatever the compiler author decided to
point it at (formally: implementation defined).
A common compiler behavior is to point to an internal function that
prints a diagnostic and aborts execution.
It is not very interesting as you cannot instantiate an abstract class
anyway.
And formally ... vptr/vtable is not mandatory. If you can figure out a
different mechanism it's ok.