Virtual constructor
Why cant we have a virtual constructor?
All the materials give somewhat similar anwer to this question. "First the VPTR Pointer is initialised to it's proper VTABLE by the contructor which is automatically done by the compiler ,,,," or "You don’t ever want to be able to make a call to a virtual function before the VPTR is properly initialized. Of course, the place where initialization can be
guaranteed is in the constructor, ....." or something similar to this.
My doubt is whether the constructor in question base class constructor???
dilip.mathews
Junior Poster in Training
89 posts since Jun 2006
Reputation Points: 16
Solved Threads: 3
Agreed to that ... Can you make it clear, when the initialization of virtual pointer with the address of virtual table will take place???
dilip.mathews
Junior Poster in Training
89 posts since Jun 2006
Reputation Points: 16
Solved Threads: 3