Re: call base class function or derived class function

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9E2F1FBE-8F2F-432A-A2BA-BA5AE5070566@xxxxxxxxxxxxx
I have performed experiment, you are correct and there is vtable for
abstract class in its constructor. But its content is so confusing.

Here is the content of vtable when I get from constructor of base
abstract class.

- __vfptr 0x00df574c const Foo::`vftable' *
[0] 0x00df1168 __purecall *

__purecall is the function provided by CRT. MSVC compiler puts it into
vtable slots corresponding to pure virtual functions. When called, it
prints a diagnostic message then aborts the program (of course, in a
valid program it would never be called).
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: abstract constructor performance?
    ... > the performance hit of the call to the abstract constructor under load. ... my code creates about 200 instances of the subclasses ... If the abstract class has no constructor, then there's no call to it? ... The call itself has a negligible performance penalty - if performance was a ...
    (comp.lang.java.programmer)
  • Re: Factory method
    ... > factory method in my abstract class that creates subclasses. ... > constructor in my subclasses must be able to call the constructor in my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Factory method
    ... > factory method in my abstract class that creates subclasses. ... > constructor in my subclasses must be able to call the constructor in my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: extending abstract class
    ... > public FileCommand{//can abstract class throw extension? ... > public class ByteChar extends FileCommand { ... it means that this constructor will call the constructor of the ... As Strings are object a direct comparison compares on a reference ...
    (comp.lang.java.help)
  • Re: extending abstract class
    ... > public FileCommand{//can abstract class throw extension? ... > public class ByteChar extends FileCommand { ... it means that this constructor will call the constructor of the ... As Strings are object a direct comparison compares on a reference ...
    (comp.lang.java.help)